Important Java Questions for Exams & Viva
This document contains a curated list of important Java questions commonly asked in exams,
interviews, and viva. Practice these to strengthen your core Java knowledge.
1 What is Java and what are its main features?
2 Explain the difference between JDK, JRE, and JVM.
3 What is platform independence in Java?
4 What are the main principles of Object-Oriented Programming (OOP)?
5 Explain encapsulation with an example.
6 What is inheritance? Explain its types in Java.
7 What is polymorphism? Differentiate between compile-time and runtime polymorphism.
8 What is abstraction and how is it achieved in Java?
9 Difference between abstract class and interface.
10 What is a constructor? Types of constructors in Java.
11 What is method overloading and method overriding?
12 What is the use of the 'final' keyword in Java?
13 Explain the concept of packages in Java.
14 What is exception handling? Explain try, catch, finally, throw, and throws.
15 Difference between checked and unchecked exceptions.
16 What is multithreading in Java?
17 Difference between Thread class and Runnable interface.
18 What is synchronization and why is it needed?
19 Explain the life cycle of a thread.
20 What is the difference between String, StringBuilder, and StringBuffer?
21 What is garbage collection in Java?
22 Explain the concept of wrapper classes.
23 What is autoboxing and unboxing?
24 Difference between Array and ArrayList.
25 Explain Java Collections Framework.
26 Difference between List, Set, and Map.
27 What is HashMap and how does it work?
28 Difference between HashMap and Hashtable.
29 What is the use of the static keyword?
30 What is a static block?
31 Explain access modifiers in Java.
32 What is the difference between public, private, protected, and default?
33 What is serialization and deserialization?
34 What is the transient keyword?
35 Explain the File handling classes in Java.
36 What is JDBC? Explain its architecture.
37 Steps to connect Java with a database.
38 What is the difference between Statement and PreparedStatement?
39 What is lambda expression in Java?
40 Explain functional interfaces.
41 What is the Stream API?
42 What are annotations in Java?
43 Difference between == and equals() method.
44 What is immutability? Why is String immutable?
45 Explain the MVC architecture in Java applications.
46 What is the difference between compile-time and runtime errors?
47 What is the purpose of the main() method?
48 Explain class loading in Java.
49 What are Java Beans?
50 What is reflection in Java?