Java is the most common language in Indian fresher hiring. Here are the Java interview questions freshers are asked most often, with clear answers.
Java Basics
1. Is Java fully object-oriented? No — it uses primitive types (int, char, boolean) which aren't objects, so it's "almost" fully object-oriented.
2. Difference between JDK, JRE and JVM? JVM runs bytecode; JRE = JVM + libraries to run apps; JDK = JRE + compiler and tools to develop apps.
3. What is the difference between == and .equals()? `==` compares references (memory addresses); `.equals()` compares values/content.
OOP in Java
4. Explain the four OOP pillars in Java. Encapsulation (private fields + getters/setters), Abstraction (abstract classes/interfaces), Inheritance (extends), Polymorphism (overloading & overriding).
5. Abstract class vs interface? An abstract class can have state and concrete methods; an interface (pre-Java 8) only had abstract methods. A class can implement many interfaces but extend only one class.
Core Concepts
6. What is the difference between String, StringBuilder and StringBuffer? String is immutable; StringBuilder is mutable and fast (not thread-safe); StringBuffer is mutable and thread-safe.
7. What are collections? ArrayList vs LinkedList? The Collections framework provides data structures. ArrayList = fast random access; LinkedList = fast insertions/deletions.
8. HashMap vs HashSet? HashMap stores key-value pairs; HashSet stores unique values (backed by a HashMap).
9. What is exception handling? Using try-catch-finally and throws to handle runtime errors gracefully. Checked exceptions are caught at compile time; unchecked at runtime.
10. What is the static keyword? Belongs to the class, not instances — shared across all objects (e.g., static variables and methods).
Quick Tips
- •Be ready to write small programs (reverse a string, find duplicates, FizzBuzz)
- •Mention Java 8 features (lambdas, streams) for bonus points
- •Tie answers to projects you built in Java
Practice with our [interview prep resources](/interview-prep) and review general technical interview questions. Then [create a free profile](/candidate/register) and apply to Java fresher jobs.
