Java MCQ Quiz

  1. Java was originally developed by -
  2. Which of the following function is used to find and fix bugs in the Java programs ?
  3. _________is the return type of the hashCode() method in the Object class?
  4. Which of the following option is a valid long literal?
  5. A single read/write operation performs _____ In character stream I/O.
  6. ______________ is the order of variables in Enum?
  7. Which of the following method returns the elements of Enum class?
  8. Which of the following is the limitation of toString() method of BigDecimal?
  9. BigDecimal is a part of___________ package?
  10. The LocalTime represents -
  11. How to get UTC time using Java ?
  12. Literals in java must be appended by -
  13. Which of the following is Truncation is Java?
  14. Arrays are _______ in Java?
Java MCQ

Take Java Quiz To test your Knowledge 

Below are few Java MCQ test that checks your basic knowledge of Java. This Java Test contains around 20 questions of multiple choice with 4 options. You have to select the right answer to a question. You can see the correct answer by clicking view answer link.

Also, Read Best Java interview questions.

  • Brendan Eich
  • James Gosling
  • Tim Berners-Lee
  • Guido van Rossum
View Answer
  • JVM
  • JDK
  • JRE
  • JDB
  • Eight bytes read/write at a time
  • Two bytes read/write at a time
  • One byte read/write at a time
  • Five bytes read/ write at a time
View Answer
  • Descending order
  • Ascending order
  • Random order
  • Depends on the order
View Answer
  • getEnumList()
  • getEnum()
  • getEnumConstants()
  • getEnums()
View Answer
  • toString returns null
  • toString uses scientific notation
  • toString returns the number in expanded form
  • None of the above
View Answer
  • java.math
  • java.lang
  • java.util
  • java.io
View Answer
  • Time without Date
  • Date without time
  • Date and Time
  • Date and Time with timezone
View Answer
  • Date.getUTC();
  • Time.getUTC();
  • Instant.now();
  • TimeZone.getUTC();
View Answer
  • Integer value assigned to floating type
  • Integer value assigned to floating type
  • Floating-point value assigned to an integer type
  • Floating-point value assigned to an Floating type
View Answer
  • primitive data type
  • objects
  • object references
  • None of These
View Answer
  • int [] myList = (5, 8, 2);
  • int myList [] = {4, 3, 7};
  • int myList [] [] = {4,9,7,0};
  • None of These
View Answer
  • A copy of the array
  • The length of the array
  • A copy of the first element
  • The reference of the array
View Answer
  • Runtime - NullPointerException
  • Compile time Exception
  • Eror
  • None of These
View Answer
  • Import pkg.
  • import pkg.
  • Import pkg.*
  • import pkg.*
View Answer