CodeZov Java MCQ Bank

Java Multiple Choice Questions

Test your Java knowledge across JVM, OOP, Collections, Multithreading, Streams, and JDBC.

Q1Java Basics & JVMBEGINNER

Which component of the Java ecosystem is responsible for compiling `.java` source files into `.class` bytecode?

Q2Java Basics & JVMBEGINNER

What is the size and default value of a `long` primitive in Java?

Q3Java Basics & JVMBEGINNER

What will be the output of the following Java snippet?

int x = 7;
int y = 2;
System.out.println(x / y);
Q4Java OOP, Inheritance & PolymorphismINTERMEDIATE

Why does Java disallow multiple inheritance of classes using `extends`?

Q5Java OOP, Inheritance & PolymorphismBEGINNER

Which keyword is used inside a subclass constructor to invoke its parent class constructor?

Q6Java Collections & GenericsADVANCED

In Java 8+, what happens when a single `HashMap` bucket exceeds 8 entries (and table capacity >= 64)?

Q7Java Collections & GenericsBEGINNER

Which List implementation provides O(1) random access by index (`get(i)`)?

Q8Java Exceptions, Multithreading & Java 8 StreamsINTERMEDIATE

What happens if you call `thread.run()` directly instead of `thread.start()`?

Q9Java Exceptions, Multithreading & Java 8 StreamsINTERMEDIATE

Which Stream API operation is a terminal operation?