100 Core Java Interview Questions - Sectionwise
1. Basics of Java
1. What is Java?
2. Explain the features of Java.
3. What is JVM, JRE, and JDK?
4. Difference between JDK and JRE.
5. What are the different data types in Java?
6. Explain the concept of a variable in Java.
7. What are operators in Java?
8. Explain the concept of type casting.
9. What is the difference between static and non-static methods?
10. What is a package in Java?
2. Control Statements
1. Explain if-else statement in Java.
2. What is the switch statement?
3. Difference between while and do-while loop.
4. How does the for loop work?
5. What are break and continue statements?
6. What is the return statement?
7. Can we use nested loops in Java?
8. Explain labeled loops in Java.
9. What is the purpose of an enhanced for loop?
10. What is the use of the ternary operator?
3. Object-Oriented Programming
1. What are the main principles of OOP?
2. What is a class and an object?
3. Difference between constructor and method.
4. What is method overloading?
5. What is method overriding?
6. Explain inheritance with an example.
7. What is encapsulation in Java?
8. Define polymorphism and its types.
9. What is abstraction in Java?
10. What are access specifiers?
4. Exception Handling
1. What is an exception in Java?
2. Difference between checked and unchecked exceptions.
3. What is try-catch block?
4. Explain finally block.
5. What is the throw keyword?
6. What is the throws keyword?
7. Custom exception handling in Java.
8. Difference between final, finally, and finalize.
9. What are common exceptions in Java?
10. What happens if an exception is not handled?
5. Arrays and Strings
1. What is an array in Java?
2. How to declare and initialize an array?
3. What are multidimensional arrays?
4. How do you loop through an array?
5. What are common array exceptions?
6. What is a String in Java?
7. Difference between String, StringBuffer, and StringBuilder.
8. Explain immutability of Strings.
9. How to compare two strings?
10. What are common String methods?
6. Collections Framework
1. What is the Collection Framework?
2. Difference between List, Set, and Map.
3. Explain ArrayList and LinkedList.
4. What is the difference between HashSet and TreeSet?
5. What is the use of HashMap?
6. How does TreeMap work?
7. What is the difference between Iterator and ListIterator?
8. What is the use of Queue interface?
9. What are generics in Java?
10. Explain Comparable and Comparator interfaces.
7. Multithreading
1. What is multithreading in Java?
2. Difference between process and thread.
3. How to create a thread in Java?
4. What is the lifecycle of a thread?
5. Difference between Runnable and Thread.
6. What is synchronization?
7. What is the use of volatile keyword?
8. Difference between wait and sleep methods.
9. What is a deadlock?
10. What are thread priorities?
8. Java 8 Features
1. What are the new features in Java 8?
2. Explain lambda expressions.
3. What is the Stream API?
4. What are functional interfaces?
5. Explain method references.
6. What are default and static methods in interfaces?
7. What is the Optional class?
8. Explain forEach method.
9. What are Collectors in Stream API?
10. How does filtering work in Streams?
9. Miscellaneous
1. What is the difference between == and equals()?
2. What is a singleton class?
3. What is a wrapper class?
4. Explain autoboxing and unboxing.
5. What is the use of the transient keyword?
6. What is serialization and deserialization?
7. Difference between abstract class and interface.
8. What are annotations in Java?
9. What is garbage collection?
10. What is the finalize method?