Core Java MCQ Questions and Answers: Take Online Java MCQ Test To Test Your Knowledge
Core Java MCQ Questions and Answers: Take Online Java MCQ Test To Test Your Knowledge
com
Core Java MCQ Questions and Answers
A. Brendan Eich
B. James Gosling
C. Tim Berners-Lee
D. Guido van Rossum
Q2. Which of the following function is used to find and fix bugs in the Java programs ?
A. JVM
B. JDK
C. JRE
D. JDB
Q3. _________is the return type of the hashCode() method in the Object class?
A. int
B. Object
C. void
D. long
A. L990023
B. ABH8097
C. 904423
D. 0xnf029L
A. Descending order
B. Ascending order
C. Random order
D. Depends on the order
Q7. Which of the following method returns the elements of Enum class?
A. getEnumList()
B. getEnum()
C. getEnumConstants()
D. getEnums()
A. java.math
B. java.lang
C. java.util
D. java.io
Q10. The LocalTime represents -
A. Date.getUTC();
B. Time.getUTC();
C. Instant.now();
D. TimeZone.getUTC();
A. D
B. I
C. L
D. L & l
A. Runtime - NullPointerException
B. Compile time Exception
C. Eror
D. None of These
A. Pkg
B. pkg
C. package
D. Package
A. Import pkg.
B. import pkg.
C. Import pkg.*
D. import pkg.*
Q20. Which of the following method of class String is used to obtain length of String
object?
A. lengthof()
B. Sizeof()
C. length()
D. lengthof()
A. -128 to 127
B. -32768 to 32767
C. -2147483648 to 2147483647
D. None of the Above
Q22. Which data type value is returned by all transcendental math functions?
A. int
B. float
C. long
D. double
Q23. Which of these coding types is used for data type characters in Java?
A. ASCII
B. UNICODE
C. ISO-LATIN-1
D. All of the Above
A. boolean b1 = 1;
B. boolean b4 = ‘true’
C. boolean b3 = false;
D. boolean b2 = ‘false’;
Q25. Which of the following method returns the elements of Enum class?
A. getEnum()
B. getEnums()
C. getEnumList()
D. getEnumConstants()
Q26. BigDecimal is a part of ............... package.
A. java.io
B. java.util
C. java.math
D. java.lang
A. DateFormat
B. DateConverter
C. SimpleFormat
D. SimpleDateFormat
A. 0x99fffL
B. 0x99fffa
C. AbcDefG
D. None of the above
A. Integers
B. Floating – point numbers
C. Both Integers and floating – point numbers
D. None of the above