Java MCQs

Multiple choice questions on core Java, object-oriented programming, inheritance, JVM, exceptions, and collections.

37 MCQs3 subtopicsProgrammingAll Levels
Key Concept Overview & Exam Context

Review core principles of Java before answering questions. These questions simulate placement technical assessments (TCS, Infosys, Amazon), university exams (CS/IT), and technical certifications.

Target Readiness
Placements & Job Interviews
Question Format
Multiple-Choice with Explanations
Verified Solutions
Step-by-step Output Traces

Java MCQ Questions

Page 2 of 2 (37 total)
Q1

Which of the following is NOT a Java primitive data type?

easy
Correct Answer: String
Explanation:
String is an object reference class in Java (java.lang.String), whereas int, boolean, and char are primitive types.
Q2

Which keyword is used by a class to inherit from another class in Java?

easy
Q3

Which of the following is NOT a Java primitive data type?

easy
Q4

Which of the following keywords is used to inherit a class in Java?

easy
Q5

Which of the following is a checked exception in Java?

medium
Q6

Which Java collection class does NOT guarantee the insertion order of elements?

easy
Q7

Why does Java NOT support multiple inheritance through classes?

medium
Q8

What is the default value of a local boolean variable declared inside a method in Java?

medium
Q9

What is the default value of a local boolean variable declared inside a method in Java?

medium
Q10

Can a Java class directly inherit multiple classes using the extends keyword?

easy
Q11

Which of the following members of a superclass are NEVER inherited by a subclass?

medium
Q12

Which component of the Java environment is responsible for converting bytecode into machine-specific native machine code at runtime?

medium
Q13

Which component of the Java environment is responsible for converting bytecode into machine-specific native machine code at runtime?

medium
Q14

Which memory area in the JVM stores newly created objects and instance variables?

easy
Q15

What happens if a superclass method is declared as final?

easy
Q16

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

easy
Q17

In constructor chaining, which statement is true regarding the super() call in a subclass constructor?

medium
Showing 21 to 37 of 37 questions