Here’s a Basic Java Interview Questions & Answers guide to help you
prepare for entry-level or junior Java developer roles. This list covers core
Java concepts commonly asked in interviews:
✅ 1. What is Java?
Java is a high-level, object-oriented programming language developed by
Sun Microsystems (now owned by Oracle). It is platform-independent
due to the Java Virtual Machine (JVM).
✅ 2. What are the main features of Java?
Object-Oriented
Platform Independent
Simple and Secure
Robust and Multithreaded
Architecture-neutral
High performance (via Just-In-Time compiler)
3. What is the JVM, JRE, and JDK?
Term Description
JVM (Java Virtual Machine) Executes Java bytecode
JRE (Java Runtime Environment) JVM + Libraries to run Java apps
JDK (Java Development Kit) JRE + Development tools (compiler, debugger, etc.)
4. What is the difference between == and .equals() in Java?
== compares object references (memory addresses).
.equals() compares object content/values (when overridden
properly, especially in String, Integer, etc.).
✅ 5. What is a Class and an Object?
Class: A blueprint for creating objects (e.g., Car).
Object: An instance of a class (e.g., Car myCar = new Car();).
✅ 6. What are constructors in Java?
Constructors are special methods used to initialize objects. They have
the same name as the class and no return type.
✅ 7. What is Inheritance in Java?
Inheritance allows a class to inherit properties and methods from
another class.
class Animal {
void eat() { System.out.println("Eating"); }
class Dog extends Animal {
void bark() { System.out.println("Barking"); }
8. What is Polymorphism?
Polymorphism means one name, many forms. It allows you to use a
method in different ways:
Compile-time (method overloading)
Runtime (method overriding)
✅ 9. What is Abstraction?
Abstraction is hiding implementation details and showing only essential
features. Achieved using:
Abstract classes
Interfaces
✅ 10. What is Encapsulation?
Encapsulation is the process of binding data and methods into a single
unit (class) and restricting access using access modifiers (private,
public, etc.).