Top 25 Java Coding Interview Questions with Answers (2025 Edition)
1. What is the difference between JDK, JRE, and JVM?
JDK (Java Development Kit) is a software development environment.
JRE (Java Runtime Environment) provides libraries and JVM.
JVM (Java Virtual Machine) runs Java bytecode on any platform.
2. What are the main features of Java?
Object-oriented, Platform-independent, Secure, Robust, Portable, Multithreaded.
3. What is the difference between '==' and '.equals()' in Java?
'==' checks reference equality (memory address), while '.equals()' checks object value equality.
4. What is a constructor in Java?
A constructor is a special method used to initialize objects. It has the same name as the class.
5. What is method overloading and method overriding?
Overloading: Same method name with different parameters in the same class.
Overriding: Subclass provides specific implementation of a method already defined in its parent
class.