Java Online Quiz 2

10 Questions | Total Attempts: 324

SettingsSettingsSettings
Please wait...
Java Online Quiz 2

.


Questions and Answers
  • 1. 
    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

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

      Int

    • B. 

      Float

    • C. 

      Double

    • D. 

      Long

  • 3. 
    Which of the following coding types is used for the data type characters in Java ?
    • A. 

      ISO-LATIN-1

    • B. 

      UNICODE

    • C. 

      ASCII

    • D. 

      None of the above

  • 4. 
    Which of the following values, a boolean variable can contain ?
    • A. 

      True and False

    • B. 

      Any integer value

    • C. 

      0 and 1

    • D. 

      None of the above

  • 5. 
    Which of the following is a correct declaration of variable in Java ?
    • A. 

      Int num

    • B. 

      Int-num

    • C. 

      Int num;

    • D. 

      Int-num;

  • 6. 
    Which of the following is a correct variable initialization in Java ?
    • A. 

      Int num = 10

    • B. 

      Int-num = 10

    • C. 

      Int num = 10;

    • D. 

      Int-num = 10

  • 7. 
     What is the default value of the data type byte in Java ?
    • A. 

      0

    • B. 

      Null

    • C. 

      1

    • D. 

      None of the above

  • 8. 
    What is the default value of the data type int in Java ?
    • A. 

      1

    • B. 

      0

    • C. 

      0i

    • D. 

      None of the above

  • 9. 
    What is the default value of the data type long in Java ?
    • A. 

      0

    • B. 

      1

    • C. 

      0L

    • D. 

      10

  • 10. 
    What is the default value of the data type double in Java ?
    • A. 

      0

    • B. 

      1

    • C. 

      0.0D

    • D. 

      0.0

Back to Top Back to top