80 Java Interview Questions for Freshers and Professionals in 2026
This is a broad set of Java interview questions spanning multiple levels, from foundational concepts for freshers to advanced topics for experienced professionals.
For Freshers
1. What is Java, and what are its main features?
Java is a platform-independent, object-oriented programming language known for features like automatic memory management, multithreading, and strong security.
2. What is the difference between JDK, JRE, and JVM?
JVM runs bytecode, JRE provides the JVM plus libraries, and JDK adds development tools like the compiler on top of the JRE.
3. What are the four pillars of OOPs?
Encapsulation, Abstraction, Inheritance, and Polymorphism.
4. What is a constructor?
A special block used to initialize objects, with the same name as the class and no return type.
5. What is the difference between an array and an ArrayList?
Arrays have a fixed size set at creation, while ArrayLists can grow or shrink dynamically.
For Experienced Professionals
6. How does HashMap work internally?
It stores key-value pairs in buckets based on hash codes, using linked lists or trees within buckets to handle collisions.
7. What is the difference between checked and unchecked exceptions?
Checked exceptions are validated at compile time; unchecked exceptions occur at runtime and extend RuntimeException.
8. How do you design a thread-safe Singleton?
Using double-checked locking with a volatile instance variable, or an enum-based Singleton for simplicity and safety.
9. What is the Streams API used for?
Processing collections declaratively using chained operations like filter, map, and reduce, introduced in Java 8.
10. How would you design a microservice using Spring Boot?
By creating an independent, self-contained Spring Boot application exposing REST endpoints, with its own database and configuration, communicating with other services over REST or messaging.
Master Java with Uncodemy
Hands-on training, live projects, and placement support in our Java Programming Course.