Comprehensive collection of the most frequently asked Java interview questions covering fundamentals, OOP concepts, collections, multithreading, exception handling, JVM internals, and advanced topics. Each answer is concise, detailed, and interview-ready.
0%
Overall Progress
0/110
Status
Problem
Level
2.Explain the concept of 'Write Once, Run Anywhere' (WORA)
Easy
3.What is the Java Virtual Machine (JVM) and its role?
Easy
4.Differentiate between JDK, JRE, and JVM
Easy
5.What are the primitive data types in Java?
Easy
6.What are wrapper classes and why are they used?
Easy
7.What are the four main principles of Object-Oriented Programming?
Easy
8.What is a class in Java and how do you define one?
Easy
9.What is an object in Java?
Easy
10.What is a constructor in Java?
Easy
11.Explain the 'public static void main(String[] args)' method
Easy
12.What is the difference between instance variables and local variables?
Easy
13.What are static variables and methods?
Easy
14.What is method overloading?
Easy
15.What is method overriding?
Medium
16.What is inheritance in Java?
Easy
17.What is the difference between an interface and an abstract class?
Medium
18.What is encapsulation and how is it achieved?
Easy
19.What is polymorphism in Java?
Medium
20.What is abstraction in Java?
Medium
21.What is the difference between == and equals() method?
Easy
22.What is the String class and is it mutable or immutable?
Easy
23.What is the difference between String, StringBuilder, and StringBuffer?
Medium
24.What is garbage collection in Java?
Medium
25.Explain the try-catch-finally block
Easy
26.What is the difference between checked and unchecked exceptions?
Medium
27.What is the purpose of the final keyword?
Easy
28.What is the this keyword in Java?
Easy
29.What is the super keyword in Java?
Easy
30.What is autoboxing and unboxing?
Medium
31.What is the Java Collections Framework?
Medium
32.What is the difference between ArrayList and LinkedList?
Medium
33.What is the difference between HashMap and Hashtable?
Medium
34.What is the difference between Set and List?
Easy
35.What is an Iterator and how is it used?
Medium
36.What is the difference between fail-fast and fail-safe iterators?
Hard
37.What is multithreading in Java?
Medium
38.What is the difference between Thread and Runnable?
Medium
39.What is thread synchronization and why is it important?
Medium
40.Explain the synchronized keyword
Medium
41.What is a deadlock and how can it be prevented?
Hard
42.What is the volatile keyword?
Hard
43.What are wait(), notify(), and notifyAll() methods?
Hard
44.What is the Java Memory Model?
Hard
45.How does the JVM organize memory?
Hard
46.What is the difference between heap and stack memory?
Medium
47.What are generics in Java?
Medium
48.What is serialization and deserialization?
Hard
49.What is the transient keyword?
Medium
50.What is reflection in Java?
Hard
51.What are lambda expressions in Java 8?
Medium
52.What are functional interfaces?
Medium
53.What is the Stream API in Java 8?
Medium
54.What is the Optional class in Java 8?
Medium
55.What are default methods in interfaces?
Medium
56.What is method reference in Java 8?
Medium
57.What is the difference between Comparable and Comparator?
Medium
58.What is the difference between Runnable and Callable?
Hard
59.What is Future in Java?
Hard
60.What is ExecutorService?
Hard
61.What is the Singleton design pattern?
Hard
62.What is the Factory design pattern?
Hard
63.What is dependency injection?
Hard
64.What is immutability and its benefits?
Hard
65.What is the difference between throw and throws?
Easy
66.What is a custom exception?
Medium
67.What is the difference between error and exception?
Medium
68.What is JDBC and its components?
Medium
69.What is the difference between Statement and PreparedStatement?
Medium
70.What is a connection pool?
Hard
71.What is the difference between abstract class and interface in Java 8+?
Hard
72.What is composition over inheritance?
Hard
73.What are SOLID principles?
Hard
74.What is the difference between process and thread?
Medium
75.What is the CompletableFuture?
Hard
76.What is the fork/join framework?
Hard
77.What is CountDownLatch?
Hard
78.What is CyclicBarrier?
Hard
79.What is Semaphore in Java?
Hard
80.What is ConcurrentHashMap and how does it work?
Hard
81.What is ThreadLocal?
Hard
82.What are atomic variables?
Hard
83.What is the difference between ArrayList and Vector?
Medium
84.What is the difference between HashSet and TreeSet?
Medium
85.What is the difference between HashMap and TreeMap?
Medium
86.What is the equals() and hashCode() contract?
Medium
87.What is the purpose of the finalize() method?
Medium
88.What is the difference between shallow copy and deep copy?
Hard
89.What is covariant return type?
Hard
90.What is varargs in Java?
Medium
91.What are enums in Java?
Medium
92.What is annotation in Java?
Medium
93.What is the difference between Array and ArrayList?
Easy
94.What is the difference between String literal and String object?
Medium
95.What is the classpath in Java?
Medium
96.What is ClassLoader in Java?
Hard
97.What is the difference between Path and Classpath?
Easy
98.What is Just-In-Time (JIT) compiler?
Hard
99.What are different garbage collection algorithms?
Hard
100.What is the difference between heap and metaspace?
Hard
101.What is pass-by-value in Java?
Medium
102.What is the instanceof operator?
Medium
103.What is static import?
Medium
104.What is the diamond problem and how does Java handle it?
Hard
105.What is the difference between Scanner and BufferedReader?
Medium
106.What is NIO in Java?
Hard
107.What is the Service Provider Interface (SPI)?
Hard
108.What is the difference between JIT and AOT compilation?