Java MCQ Quiz Hub

Java Multiple Choice Questions

Choose a topic to test your knowledge and improve your Java skills

Which of the following option leads to the portability and security of Java?





✅ Correct Answer: 1

Which of the following is not a Java features?





✅ Correct Answer: 3

The u0021 article referred to as a





✅ Correct Answer: 1

_____ is used to find and fix bugs in the Java programs.





✅ Correct Answer: 4

What is the return type of the hashCode() method in the Object class?





✅ Correct Answer: 2

Which of the following is a valid long literal?





✅ Correct Answer: 4

What does the expression float a = 35 / 0 return?





✅ Correct Answer: 3

Evaluate the following Java expression if x=3 y=5 and z=10: ++z + y - y + z + x++





✅ Correct Answer: 4

Which of the following tool is used to generate API documentation in HTML format from doc comments in source code?





✅ Correct Answer: 3

Which of the following creates a List of 3 visible items and multiple selections abled?





✅ Correct Answer: 2

Which of the following for loop declaration is not valid?





✅ Correct Answer: 1

Which method of the Class.class is used to determine the name of a class represented by the class object as a String?





✅ Correct Answer: 3

In which process a local variable has the same name as one of the instance variables?





✅ Correct Answer: 2

Which package contains the Random class?





✅ Correct Answer: 1

What do you mean by nameless objects?





✅ Correct Answer: 4

An interface with no fields or methods is known as a ______.





✅ Correct Answer: 2

Which of the following is an immediate subclass of the Panel class?





✅ Correct Answer: 1

Which option is false about the final keyword?.





✅ Correct Answer: 3

Which of these classes are the direct subclasses of the Throwable class?





✅ Correct Answer: 3

What do you mean by chained exceptions in Java?





✅ Correct Answer: 2

In which memory a String is stored when we create a string using new operator?





✅ Correct Answer: 3

What is the use of the intern() method?





✅ Correct Answer: 1

Which of the following is a marker interface?





✅ Correct Answer: 2

Which of the following is a reserved keyword in Java?





✅ Correct Answer: 2

Which keyword is used for accessing the features of a package?





✅ Correct Answer: 2

In java jar stands for_____.





✅ Correct Answer: 4

Which of the following is false?





✅ Correct Answer: 2

What is the use of w in regex?





✅ Correct Answer: 3

Which of the given methods are of Object class?





✅ Correct Answer: 3

Given that Student is a class how many reference variables and objects are created by the following code? Student studentName studentId; studentName = new Student(); Student stud_class = new Student();





✅ Correct Answer: 1