1. What is Java?
Java is a high-level, object-oriented, platform-independent programming language. It follows the principle of Write Once, Run Anywhere (WORA) using the JVM.
2. What are the main features of Java?
Java is platform-independent, object-oriented, secure, robust, and multithreaded. It also provides automatic memory management through Garbage Collection.
3. What is JVM?
JVM (Java Virtual Machine) is an engine that runs Java bytecode. It provides platform independence by converting bytecode into machine-specific code.
4. What is JDK?
JDK (Java Development Kit) is a software package used to develop Java applications. It includes JRE, compiler (javac), and development tools.
5. What is JRE?
JRE (Java Runtime Environment) provides libraries and JVM required to run Java programs. It does not contain development tools like a compiler.
6. What is the difference between JDK, JRE, and JVM?
JDK is for development, JRE is for running applications, and JVM executes bytecode. JDK contains JRE, and JRE contains JVM.
7. What is Object-Oriented Programming (OOP)?
OOP is a programming paradigm based on objects and classes. It focuses on encapsulation, inheritance, polymorphism, and abstraction.
8. What is a Class?
A class is a blueprint or template for creating objects. It defines properties (variables) and behaviors (methods).
9. What is an Object?
An object is an instance of a class. It represents a real-world entity with state and behavior.
10. What is Encapsulation?
Encapsulation is wrapping data and methods into a single unit (class). It protects data by restricting direct access using private variables.
11. What is Inheritance?
Inheritance allows one class to acquire properties and methods of another class. It promotes code reusability and hierarchical relationships.
12. What is Polymorphism?
Polymorphism means “many forms.” It allows methods to perform different tasks through method overloading and overriding.
13. What is Abstraction?
Abstraction hides internal implementation details and shows only functionality. It is achieved using abstract classes and interfaces.
14. What is Method Overloading?
Method overloading occurs when multiple methods have the same name but different parameters. It is resolved at compile time.
15. What is Method Overriding?
Method overriding happens when a subclass provides a specific implementation of a parent class method. It supports runtime polymorphism.
16. What is a Constructor?
A constructor is a special method used to initialize objects. It has the same name as the class and does not have a return type.
17. What is the difference between == and equals()?
== compares object references or primitive values. equals() compares the actual content of objects.
18. What is a String in Java?
String is a class used to represent sequences of characters. String objects are immutable, meaning their values cannot be changed.
19. Why is String immutable?
String is immutable for security, performance, and thread safety. It allows safe sharing of string instances.
20. What is the difference between String, StringBuilder, and StringBuffer?
String is immutable, while StringBuilder and StringBuffer are mutable. StringBuffer is thread-safe; StringBuilder is faster but not thread-safe.
21. What is the Java Collections Framework?
It is a framework that provides classes and interfaces to store and manipulate data.
Examples include List, Set, and Map.
22. What is the difference between Array and ArrayList?
Arrays have fixed size, while ArrayList can grow dynamically. ArrayList provides built-in methods for data manipulation.
23. What is a HashMap?
HashMap stores key-value pairs. It allows one null key and multiple null values.
24. What is the difference between HashMap and HashSet?
HashMap stores key-value pairs. HashSet stores only unique values.
25. What is Exception Handling?
Exception handling manages runtime errors to maintain program flow. It uses try, catch, finally, throw, and throws keywords.
26. What is the difference between Checked and Unchecked Exceptions?
Checked exceptions are checked at compile time. Unchecked exceptions occur at runtime.
27. What is a finally block?
The finally block executes whether an exception occurs or not. It is mainly used to close resources.
28. What is Multithreading?
Multithreading allows multiple threads to run simultaneously. It improves performance and CPU utilization.
29. What is the difference between Process and Thread?
A process is an independent program in execution. A thread is a lightweight sub-process within a process.
30. What is Synchronization?
Synchronization controls access to shared resources in multithreading. It prevents data inconsistency issues.
31. What is the difference between static and non-static?
Static members belong to the class. Non-static members belong to objects.
32. What is the main method in Java?
The main method is the entry point of a Java program. Its signature is: public static void main(String[] args).
33. What is Garbage Collection?
Garbage Collection automatically removes unused objects from memory. It helps manage heap memory efficiently.
34. What is the use of this keyword?
this refers to the current class object. It is used to differentiate instance variables from local variables.
35. What is the use of super keyword?
super refers to the parent class object. It is used to access parent class methods and constructors.
36. What is an Interface?
An interface is a blueprint of a class. It contains abstract methods by default.
37. Can a class implement multiple interfaces?
Yes, a class can implement multiple interfaces. Java supports multiple inheritance through interfaces.
38. What is an Abstract Class?
An abstract class cannot be instantiated. It can contain both abstract and non-abstract methods.
39. What is the difference between Abstract Class and Interface?
An abstract class can have constructors and concrete methods. An interface mainly contains abstract methods and supports multiple inheritance.
40. What is the final keyword?
final restricts modification. It can be used with variables, methods, and classes.
41. What is the difference between break and continue?
break exits the loop immediately. continue skips the current iteration.
42. What is Type Casting?
Type casting converts one data type into another. It can be implicit or explicit.
43. What is Wrapper Class?
Wrapper classes convert primitive data types into objects.
Example: int → Integer.
44. What is the difference between throw and throws?
throw is used to explicitly throw an exception. throws declares exceptions in a method signature.
45. What is a Package in Java?
A package is a namespace that groups related classes and interfaces. It helps organize code and avoid naming conflicts.
46. What is a Marker Interface?
A marker interface is an empty interface. It is used to indicate special behavior to the JVM.
47. What is the difference between public, private, protected?
These are access modifiers controlling visibility. public is accessible everywhere, private within class, protected within package and subclasses.
48. What is Method Signature?
Method signature includes method name and parameters. Return type is not part of the signature.
49. What is a Singleton Class?
Singleton class allows only one instance of a class. It is commonly used for database connections.
50. Why is Java platform independent?
Java is platform independent because it uses bytecode. Bytecode runs on any system that has a JVM.
Conclusion
Core Java remains the foundation for building strong programming and problem-solving skills. Mastering these 50 frequently asked interview questions will help freshers build confidence and perform better in technical interviews.
Understanding concepts like OOP, JVM, exception handling, collections, and multithreading not only helps you clear interviews but also strengthens your real-world coding ability. Focus on clarity of concepts, practice coding regularly, and try to explain answers in simple terms during interviews.
With consistent preparation and revision, cracking a Core Java interview becomes much easier. Keep learning, keep practicing, and stay confident success will follow.



