Interface vs. Abstract Class
Definition:
An interface is a contract of methods (implicitly abstract), while an abstract class can have both abstract and concrete methods.
ArrayList vs. LinkedList
Definition:
ArrayList is backed by a dynamic array; LinkedList is a doubly linked list.
final, finally, finalize
Definition:
- final: keyword for constants or methods that cannot be overridden.
- finally: a block that always executes after try-catch.
- finalize(): (deprecated) called by GC before object removal.
== vs. equals()
Definition:
“==” checks reference equality for objects, while equals() checks logical (content) equality.
Java Streams
Definition:
A sequence of elements supporting functional-style operations (map, filter, reduce).
ExecutorService
Definition:
Manages a pool of threads, simplifying concurrent execution of tasks.
JVM Memory Areas
Definition:
Java divides memory into multiple areas (Heap, Stack, Metaspace, etc.).
Garbage Collection in Java
Definition:
Automatic memory management that frees unused objects.