Java & Web Development Assessment Exam

60 Questions | Total Attempts: 102

SettingsSettingsSettings
Please wait...
Java & Web Development Assessment Exam

.


Questions and Answers
  • 1. 
    What is the range of data type short in Java?
    • A. 

      -128 to 127

    • B. 

      -32768 to 32767

    • C. 

      -2147483648 to 2147483647

    • D. 

      None of the mentioned

  • 2. 
    What is the range of data type byte in Java?
    • A. 

      -128 to 127

    • B. 

      -32768 to 32767

    • C. 

      -2147483648 to 2147483647

    • D. 

      None of the mentioned

  • 3. 
    Which of the following are legal lines of Java code?
    1. int w = (int)888.8;
    2. byte x = (byte)100L;
    3. long y = (byte)100;
    4. byte z = (byte)100L;
    • A. 

      1 and 2

    • B. 

      2 and 3

    • C. 

      3 and 4

    • D. 

      All statements are correct.

  • 4. 
    An expression involving byte, int, and literal numbers is promoted to which of these?
    • A. 

      Int

    • B. 

      Long

    • C. 

      Byte

    • D. 

      Float

  • 5. 
    Which of these literals can be contained in a data type float variable?
    • A. 

      1.7e-308

    • B. 

      3.4e-038

    • C. 

      1.7e+308

    • D. 

      3.4e-050

  • 6. 
    Which data type value is returned by all transcendental math functions?
    • A. 

      Int

    • B. 

      Float

    • C. 

      Double

    • D. 

      Long

  • 7. 
    What is the output of this program?
    • A. 

      16.34

    • B. 

      16.566666644

    • C. 

      16.46666666666667

    • D. 

      16.46666666666666

  • 8. 
    What is the output of this program?
    • A. 

      38 43

    • B. 

      39 44

    • C. 

      295 300

    • D. 

      295.04 300

  • 9. 
    What is the output of this program?
    • A. 

      25

    • B. 

      24

    • C. 

      32

    • D. 

      33

  • 10. 
    What is the output of this program?
    • A. 

      301.5656

    • B. 

      301

    • C. 

      301.56

    • D. 

      301.56560000

  • 11. 
    What is the numerical range of a char in Java?
    • A. 

      -128 to 127

    • B. 

      0 to 256

    • C. 

      0 to 32767

    • D. 

      0 to 65535

  • 12. 
    Which of these coding types is used for data type characters in Java?
    • A. 

      ASCII

    • B. 

      ISO-LATIN-1

    • C. 

      UNICODE

    • D. 

      None of the mentioned

  • 13. 
    Which of these values can a boolean variable contain?
    • A. 

      True & False

    • B. 

      0 & 1

    • C. 

      Any integer value

    • D. 

      Both a & b

  • 14. 
    Which of these occupy first 0 to 127 in Unicode character set used for characters in Java?
    • A. 

      ASCII

    • B. 

      ISO-LATIN-1

    • C. 

      None of the mentioned

    • D. 

      Both a & b

  • 15. 
    Which one is a valid declaration of a boolean?
    • A. 

      Boolean b1 = 1;

    • B. 

      Boolean b2 = ‘false’;

    • C. 

      Boolean b3 = false;

    • D. 

      Boolean b4 = ‘true’

  • 16. 
    What is the output of this program?
    • A. 

      I i i i i

    • B. 

      0 1 2 3 4

    • C. 

      I j k l m

    • D. 

      None of the mentioned

  • 17. 
    What is the output of this program?
    • A. 

      66

    • B. 

      67

    • C. 

      65

    • D. 

      64

  • 18. 
    What is the output of this program?
    • A. 

      0

    • B. 

      1

    • C. 

      True

    • D. 

      False

  • 19. 
    What is the output of this program?
    • A. 

      0

    • B. 

      1

    • C. 

      True

    • D. 

      False

  • 20. 
    What is the output of this program?
    • A. 

      162

    • B. 

      65 97

    • C. 

      67 95

    • D. 

      66 98

  • 21. 
    What are generic methods?
    • A. 

      Generic methods are the methods defined in a generic class.

    • B. 

      Generic methods are the methods that extend generic class’s methods.

    • C. 

      Generic methods are methods that introduce their own type parameters.

    • D. 

      Generic methods are methods that take void parameters.

  • 22. 
    Which of these type parameters is used for a generic methods to return and accept any type of object?
    • A. 

      K

    • B. 

      N

    • C. 

      T

    • D. 

      V

  • 23. 
    Which of these type parameters is used for a generic methods to return and accept a number?
    • A. 

      K

    • B. 

      N

    • C. 

      T

    • D. 

      V

  • 24. 
    Which of these is an correct way of defining generic method?
    • A. 

      Name(T1, T2, …, Tn) { /* … */ }

    • B. 

      Public name { /* … */ }

    • C. 

      Class name[T1, T2, ..., Tn] { /* … */ }

    • D. 

      Name{T1, T2, …, Tn} { /* … */ }

  • 25. 
    Which of the following is incorrect statement regarding the use of generics and parameterized types in Java?
    • A. 

      Generics provide type safety by shifting more type checking responsibilities to the compiler.

    • B. 

      Generics and parameterized types eliminate the need for down casts when using Java Collections.

    • C. 

      When designing your own collections class (say, a linked list), generics and parameterized types allow you to achieve type safety with just a single class definition as opposed to defining multiple classes

    • D. 

      All of the mentioned

Back to Top Back to top