Core Java Interview Questions & Answers

Master technical rounds with curated real-time questions, code walk-throughs, and Telugu pro tips.

Core Java & OOPs Total Questions: 100

Core Java Interview Questions & Answers

Java remains the powerhouse of enterprise software, microservices, and distributed backend systems. These 100 curated questions test your understanding of Object-Oriented Programming (OOP) paradigms, JVM memory zones (Heap, Stack, Metaspace), garbage collection algorithms, Collections framework data structures (HashMap collision handling), Multithreading concurrency, and Java 8-21 modern features.

Showing all 100 questions
#1

What is the difference between `==` and `equals()` in Java?

`==` compares references (memory location), while `equals()` compares actual object values for equality. Use `equals()` for content comparison and `==` for reference comparison.
#2

What is the purpose of the `final` keyword in Java?

The `final` keyword is used to define constants, prevent method overriding, and prevent class inheritance. A `final` variable cannot be reassigned, a `final` method cannot be overridden, and a `final` class cannot be subclassed.
#3

What is the difference between an `ArrayList` and a `LinkedList`?

`ArrayList` is backed by a dynamic array, while `LinkedList` is backed by a doubly linked list. `ArrayList` provides fast random access but slower insertions and deletions, while `LinkedList` provides fast insertions and deletions but slower access times.
#4

Explain the concept of Java’s pass-by-value mechanism.

#5

What is the difference between `ArrayList` and `Vector` in Java?

#6

What is the difference between `StringBuilder` and `StringBuffer`?

#7

What is an interface in Java?

#8

What is the difference between `interface` and `abstract class` in Java?

#9

What is method overloading in Java?

#10

What is method overriding in Java?

#11

What is `super` keyword in Java?

#12

Explain the concept of exception handling in Java.

#13

What is the difference between `checked` and `unchecked` exceptions in Java?

#14

What is the purpose of the `finally` block in Java?

#15

Explain the concept of multithreading in Java.

#16

What is synchronization in Java?

#17

What is a deadlock in Java?

#18

What is the purpose of the `volatile` keyword in Java?

#19

What are the differences between `String`, `StringBuilder`, and `StringBuffer`?

#20

What is the `hashCode()` method in Java?

#21

What is the difference between `ArrayList` and `LinkedList` in Java?

#22

What is the difference between `final`, `finally`, and `finalize` in Java?

#23

What is the `super()` keyword in Java?

#24

What is the difference between `throw` and `throws` in Java?

#25

How can you create a thread in Java?

#26

What is the `Collections` framework in Java?

#27

What is the difference between `HashMap` and `TreeMap` in Java?

#28

What is the `Iterable` interface in Java?

#29

What are the different types of memory areas allocated by JVM?

#30

What is the purpose of the `transient` keyword in Java?

#31

What is serialization in Java?

#32

How can you prevent a class from being subclassed in Java?

#33

What is the `instanceof` operator in Java?

#34

What is the difference between `synchronized` and `lock` in Java?

#35

What is an Enum in Java?

#36

What is a `Constructor` in Java?

#37

What is the difference between `String` and `StringBuilder`?

#38

What is a `Lambda Expression` in Java?

#39

What is the difference between `==` and `.equals()` in Java?

#40

What is the use of the `this` keyword in Java?

#41

What is the difference between `Runnable` and `Callable` in Java?

#42

What is the `Java Reflection` API?

#43

What is the difference between `Abstract Class` and `Interface` in Java?

#44

What is the purpose of the `clone()` method in Java?

#45

What is a `HashSet` in Java?

#46

What is the purpose of the `default` keyword in Java 8 interfaces?

#47

What is the difference between `ArrayList` and `CopyOnWriteArrayList` in Java?

#48

What are the main principles of Object-Oriented Programming in Java?

#49

What is a `WeakHashMap` in Java?

#50

What is the use of `Optional` in Java?

#51

What is the difference between `synchronized` method and `synchronized` block in Java?

#52

What is the `volatile` keyword in Java?

#53

What is the `ThreadPoolExecutor` in Java?

#54

How can you handle deadlocks in Java?

#55

What is a `ReentrantLock` in Java?

#56

What are the advantages of using `StringBuilder` over `String`?

#57

What is the purpose of the `default` method in Java interfaces?

#58

What is the difference between `ArrayList` and `Vector` in Java?

#59

What is the purpose of the `static` keyword in Java?

#60

What is a `Nested Class` in Java?

#61

What is a `constructor` chaining in Java?

#62

What is the difference between `abstract` class and `interface`?

#63

What is the purpose of `java.util.concurrent` package?

#64

What are `synchronized` blocks and their advantages?

#65

What is `null` in Java?

#66

What are the differences between `String`, `StringBuffer`, and `StringBuilder` in Java?

#67

How is memory managed in Java?

#68

What is the `try-with-resources` statement in Java?

#69

What is the difference between `Callable` and `Runnable` in Java?

#70

What is a `garbage collector` in Java?

#71

How does Java handle exceptions?

#72

What is the difference between `==` and `.equals()` when comparing objects?

#73

What is the significance of the `super()` constructor in Java?

#74

How does the `Java Reflection` API work?

#75

What is the difference between `ArrayList` and `LinkedList` in terms of performance?

#76

What is a `stack` in Java?

#77

What are `default` methods in Java 8?

#78

What are `Java annotations`?

#79

What is the `Cloneable` interface in Java?

#80

What is a `Map` in Java?

#81

What is a `WeakReference` in Java?

#82

What is the `final` keyword used for in Java?

#83

What are `Checked` and `Unchecked exceptions` in Java?

#84

What is the difference between `HashMap` and `TreeMap` in Java?

#85

What is `ThreadLocal` in Java?

#86

What is the purpose of the `assert` keyword in Java?

#87

How do you create a thread in Java?

#88

What is the `Factory` design pattern?

#89

What is a `Singleton` pattern in Java?

#90

What is the purpose of `Collections` class in Java?

#91

What is the difference between `StringBuffer` and `StringBuilder`?

#92

What is the use of `super` keyword in Java?

#93

What is the difference between `==` and `.equals()` in comparing two `String` objects?

#94

What is the `Clone()` method in Java?

#95

What are the benefits of using `lambda expressions` in Java?

#96

What is the difference between `String` and `StringBuilder` in terms of mutability?

#97

What is a `Marker Interface` in Java?

#98

What is the difference between `Set` and `List` in Java?

#99

What is the `hashCode()` method in Java?

#100

What is the difference between `equals()` and `compareTo()` in Java?

Need 1-on-1 Mock Interview & Career Mentorship in Telugu?

Practice live coding interviews with senior industry architects. We simulate real enterprise screening rounds for HTML, CSS, JavaScript, React, Node.js, and Java full-stack roles.