Java Fundamentals
Java With DSA — One-Page Study Document
JVM
Java source is compiled to bytecode and executed by the JVM. The JVM manages memory, class loading, runtime execution and JIT
compilation.
JDK / JRE / JVM
JDK provides development tools and the Java runtime. JVM executes bytecode. Modern Java distributions generally package the
runtime with the JDK.
OOP
Encapsulation protects state; inheritance enables reuse; abstraction exposes essential behavior; polymorphism allows one interface to
represent different implementations.
String
String is immutable. Use StringBuilder for repeated modifications. == compares references, while equals() compares logical equality.
equals() / hashCode()
If two objects are equal according to equals(), they must return the same hashCode(). This contract is critical for HashMap and
HashSet.
Exceptions
Checked exceptions are compiler-enforced. RuntimeException subclasses are unchecked. Use try-with-resources for AutoCloseable
resources.
Modern Java
Know records, sealed classes, switch expressions, lambdas, streams, Optional, pattern matching and basic virtual-thread concepts.