← All jobs

Java Interview Questions and Answers

Posted on December 05, 2026

Common Java interview questions for freshers. Tap a question to see the answer.

1. What is the difference between JDK, JRE and JVM?

The JVM runs Java bytecode. The JRE is the JVM plus the libraries needed to run programs. The JDK includes development tools such as the compiler, along with everything needed to run Java.

2. Why is Java platform independent?

Java code is compiled into bytecode, which can run on any system that has a suitable JVM.

3. What are the four main OOP concepts?

Encapsulation, inheritance, polymorphism and abstraction.

4. What is the difference between == and equals()?

For objects, == checks whether two references point to the same object. equals() can compare contents if the class overrides it, as String does.

5. What is method overloading and overriding?

Overloading means the same method name with different parameters. Overriding means a subclass provides its own version of an inherited method.

6. Why are Strings immutable?

A String cannot be changed after it is created. This allows safe sharing, reuse through the String pool and thread safety.

7. What is the difference between ArrayList and LinkedList?

ArrayList uses a resizable array and gives fast access by index. LinkedList uses linked nodes and is efficient for adding or removing at either end.

8. What is the difference between an abstract class and an interface?

An abstract class can have constructors and instance fields, and a class can extend only one. A class can implement many interfaces, whose fields are constants.

9. What are checked and unchecked exceptions?

Checked exceptions must be caught or declared, for example IOException. Unchecked exceptions are not forced by the compiler, for example NullPointerException.

10. What is garbage collection?

It is the JVM process that frees memory used by objects that can no longer be reached.

Search This Blog

Popular Jobs

Basic Java Coding Questions

Basic Java coding questions for freshers. Tap a question to see the code. Put the code inside a main method to run it. 1. Reverse a string String s = "java"; String r = new StringBuilder(s).reverse().toString(); System.out.println(r); // avaj 2. Check if a string is a palindrome String s = "madam"; String r = new StringBuilder(s).reverse().toString(); System.out.println(s.equals(r)); // true 3. Find the factorial of a number int n = 5; long fact = 1; for (int i = 2; i <= n; i++) { fact *= i; } System.out.println(fact); // 120 4. Print the Fibonacci series int a = 0, b = 1; for (int i = 0; i < 8; i++) { System.out.print(a + " "); int c = a + b; a = b; b = c; } // 0 1 1 2 3 5 8 13 5. Check if a number is prime int n = 29; boolean prime = n > 1; for (int i = 2; i <= n / i; i++) { if (n % i == 0) { prime = false; break; } } System.out.println(prime); // true 6. Find the largest ...

Engineer / Sr. Engineer PPC | Nirmal Industrial Controls | Asangaon

Company Nirmal Industrial Controls Pvt. Ltd. Role Engineer / Sr. Engineer, Production Planning and Control (PPC) Location Asangaon Experience 3 to 10 years Qualification Bachelor's degree in Mechanical Salary Not mentioned About the role Nirmal Industrial Controls is hiring for its production planning team. The role involves planning and scheduling production so that customer orders are dispatched on time. Key responsibilities Plan, schedule and control production for sales orders Meet monthly and quarterly dispatch targets and delivery dates Improve on-time, in-full (OTIF) delivery Coordinate with teams, including procurement and inventory Study production data and improve planning processes Check shop floor quality and safety compliance Preferred: Experience in the valves industry. Apply Now
↓Get free job alerts. Join now!↓
Join WhatsAppFree job alerts Join TelegramFree job alerts