Java MCQ Questions with Answers

  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 Online Java MCQ Test to test your Knowledge 

We have listed below the best Java MCQ Questions that check your basic knowledge of Java. this Java MCQ Test contains 30 basic Java MCQ Questions. You have to select the right answer to every question. Apart from this, you can download below the Java MCQ PDF for the best preparation for Java Interview.

Also, Read Best Java interview questions.

  • Brendan Eich
  • James Gosling
  • Tim Berners-Lee
  • Guido van Rossum
View Answer
  • 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
Download Free : Java MCQ PDF
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
  • -128 to 127
  • -32768 to 32767
  • -2147483648 to 2147483647
  • None of the Above
View Answer
  • int
  • float
  • long
  • double
View Answer
  • ASCII
  • UNICODE
  • ISO-LATIN-1
  • All of the Above
View Answer
  • boolean b1 = 1;
  • boolean b4 = ‘true’
  • boolean b3 = false;
  • boolean b2 = ‘false’;
View Answer
  • getEnum()
  • getEnums()
  • getEnumList()
  • getEnumConstants()
View Answer
  • java.io
  • java.util
  • java.math
  • java.lang
View Answer
  • DateFormat
  • DateConverter
  • SimpleFormat
  • SimpleDateFormat
View Answer
  • 0x99fffL
  • 0x99fffa
  • AbcDefG
  • None of the above
View Answer
  • int arr[] = new int[5]
  • int arr[] = new int[5]
  • int arr[] = int [5] new
  • None of above
View Answer
  • Integers
  • Floating – point numbers
  • Both Integers and floating – point numbers
  • None of the above
View Answer
  • "Java".toUpperCase()
  • toUpperCase("Java")
  • String.toUpperCase("Java")
  • "Java".toUpperCase("Java")
View Answer