Home / CSE MCQs / JAVA MCQs :: Data Types - Java

CSE MCQs :: JAVA MCQs

  1. What is the range of data type short in Java?
  2. A.
    -128 to 127
    B.
    -32768 to 32767
    C.
    -2147483648 to 2147483647
    D.
    None of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. What is the range of data type byte in Java?
  4. A.
    -128 to 127
    B.
    -32768 to 32767
    C.
    -2147483648 to 2147483647
    D.
    None of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. An expression involving byte, int, and literal numbers is promoted to which of these?
  6. A.
    int
    B.
    long
    C.
    byte
    D.
    float

    View Answer

    Workspace

    Discuss Discuss in Forum


  7. Which of these literals can be contained in a data type float variable?
  8. A.
    1.7e-308
    B.
    3.4e-038
    C.
    1.7e+308
    D.
    3.4e-050

    View Answer

    Workspace

    Discuss Discuss in Forum


  9. Which data type value is returned by all transcendental math functions?
  10. A.
    int
    B.
    float
    C.
    double
    D.
    long

    View Answer

    Workspace

    Discuss Discuss in Forum


  11. What is the numerical range of a char in Java?
  12. A.
    -128 to 127
    B.
    0 to 256
    C.
    0 to 32767
    D.
    0 to 65535

    View Answer

    Workspace

    Discuss Discuss in Forum


  13. Which of these coding types is used for data type characters in Java?
  14. A.
    ASCII
    B.
    ISO-LATIN-1
    C.
    UNICODE
    D.
    None of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum


  15. Which of these values can a boolean variable contain?
  16. A.
    True & False
    B.
    0 & 1
    C.
    Any integer value.
    D.
    Both a & b

    View Answer

    Workspace

    Discuss Discuss in Forum


  17. Which of these occupy first 0 to 127 in Unicode character set used for characters in Java?
  18. A.
    ASCII
    B.
    ISO-LATIN-1
    C.
    None of the mentioned
    D.
    Both a & b

    View Answer

    Workspace

    Discuss Discuss in Forum


  19. Which one is a valid declaration of a boolean?
  20. A.
    boolean b1 = 1;
    B.
    boolean b2 = 'false';
    C.
    boolean b3 = false;
    D.
    boolean b4 = 'true'

    View Answer

    Workspace

    Discuss Discuss in Forum