Java MCQ Questions

  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 MCQ Test to Test Your Knowledge

Practice here the top 50+ Java MCQ Questions, which are very popular & cover the latest and important topics of Java Programming Language. So practice these questions to check your final preparation for Java Exams, Interviews & Placement Drives. apart from this, you can also download Java MCQ PDF completely free.

  • Brendan Eich
  • James Gosling
  • Tim Berners-Lee
  • Guido van Rossum
View Answer
  • JVM
  • JDK
  • JRE
  • JDB
View Answer
  • int
  • Object
  • void
  • long
View Answer
  • L990023
  • ABH8097
  • 904423
  • 0xnf029L
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
  • D
  • I
  • L
  • L & l
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
  • Pkg
  • pkg
  • package
  • Package
View Answer
  • Import pkg.
  • import pkg.
  • Import pkg.*
  • import pkg.*
View Answer
  • lengthof()
  • Sizeof()
  • length()
  • lengthof()
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
  • int
  • long
  • float
  • double
View Answer
  • the return type of new method should exactly match that of overridden method
  • the argument list of new method should exactly match that of overridden method
  • Both A & B
  • None of the above
View Answer
  • int arr[] = new int[];
  • float arr[10] = new fl
  • double []arr = new double[10];
  • None of the above
View Answer
  • String
  • Boolean
  • Integer
  • StringBuffer
View Answer
  • Yes
  • No
View Answer
  • Runtime Exception
  • Compiletime error at line 3
  • Compiltime error at line 4,5
  • Compiletime error at lines 3,4,5
View Answer
  • abc.size
  • abc.length
  • abc.size()
  • None of the above
View Answer
  • Yield()
  • Stop()
  • Synchronization
  • None of the above
View Answer
  • Gets version 1.8.16
  • Gets version 1.8
  • Searches “ JavaVersion”
  • Gets Properties of JavaVersion
View Answer
  • Prints 0 0 0 0
  • Prints 0 0 3 0
  • Prints 0 2 0 0
  • Compile erro
View Answer
  • HashMap
  • HashTable
  • LinkedList
  • Both LinkedList & HashTable.
View Answer
  • True
  • False
View Answer
  • Sorts the instances in ascending order
  • Sorts test instances based on variable x
  • Sorts the instances in descending order.
  • None of the above
View Answer
  • String #baby;
  • Long long;
  • Short ~english;
  • All of the above
View Answer
  • Error
  • Exception
  • Runnable
  • Throwable
View Answer
  • Driver
  • ResultSet
  • Statement
  • All of the above
View Answer
  • For
  • Foreach
  • Iterator
  • ListIterator
View Answer
  • Generic Class
  • Instance Class
  • Type class
  • Base Parameter Class
View Answer
  • prepareCall()
  • CallMethod()
  • preparedCall()
  • connectioanCall()
View Answer
  • True
  • False
View Answer
  • The code runs fine
  • Runtime exception
  • compile time error at line 5
  • None of the above
View Answer
  • Object
  • Up casting
  • Down casting
  • Inheritance
View Answer
  • Compile Error
  • RunTime Error
  • Creates nodes of Linked List
  • Creates instance of Linked List
View Answer
  • static
  • abstract
  • synchronize
  • implements
View Answer
  • String
  • String [ ];
  • String [ ] [ ]
  • StringBuffer
View Answer
  • True
  • False
View Answer