Java Fundamentals
Object-Oriented Concepts
Collections and APIs
Multithreading & Concurrency
JVM Internals & Performance
100

What keyword is used to declare a variable that cannot be reassigned after initialization?

final

100

Name the four pillars of Object‑Oriented Programming (OOP)

Encapsulation, Abstraction, Inheritance, Polymorphism

100

This interface represents a collection that maintains elements in the order they were inserted

List

100

What is the term for a method that is shared by multiple threads?

Synchronization

100

What does JVM stand for?

Java Virtual Machine

200

What will be the output?

System.out.println("5" + 3);

53

200

What keyword refers to the immediate parent class and is used to access parent class methods or constructors?

super

200

Which collection stores unique elements and does not allow duplicate values?

Set/Hashset

200

Which interface should be implemented to create a task for a thread in Java?

Runnable

200

What is the term for the process that reclaims memory used by objects no longer in use?

Garbage Collection

300

What is the difference between == and .equals() when comparing strings?

== checks reference equality,

.equals() checks value equality

300

Which OOP principle allows a class to have more than one method with the same name, but different parameters?

Overloading

300

Which java collection type stores key-value pairs without allowing duplicate keys?

Map/HashMap

300

What method is called to start a thread in Java?

start()

300

What JVM feature allows you to run Java programs on different hardware architectures and operating systems without modification?

Bytecode

400

What is the output of this code?

int[] arr = {1, 2, 3};

System.out.println(arr[3]);

ArrayIndexOutOfBoundsException

400

What is it called when a subclass provides a specific implementation of a method that is already defined in its superclass?

Overriding

400

Which class in Java provides a high-performance, thread-safe queue implementation?

ConcurrentLinkedQueue

400

What is the term for two threads trying to acquire locks on each other, leading to a program freeze?

Deadlock

400

Which JVM component is responsible for converting bytecode into machine code at runtime?

JIT Compiler

500

Why does this code produce a compilation error?

int x = null;

int is a primitive type and cannot be assigned null

500

What design pattern ensures that a class has only one instance, provides a global point of access to it, and prevents instantiation via constructors?

Singleton

500

Which collection class implements a red-black tree, providing guaranteed log(n) time cost for the contains, add, and remove operations?

TreeSet

500

What keyword is used to indicate that a variable's value may be modified by multiple threads and ensures that the most up-to-date value of a variable is always visible to all threads?

volatile

500

What command-line tool can be used to monitor the JVM's garbage collection logs?

-verbose:gc

M
e
n
u