Beginner
beginnerSyntax, OOP basics, collections, exceptions, testing intro.
Java Core · companion to Unix Core, Spring Core & Service Core
Practical guides for beginners through architects—language fundamentals, OOP, collections, concurrency, JVM internals, and the frameworks teams actually ship with.
Thirty years after Oak, Java remains the default when you need predictable performance, a deep talent pool, and a battle-tested ecosystem—not hype, but trade-offs that still win in banks, Android, and cloud backends.
Bytecode on the JVM abstracts OS and CPU. Ship one JAR to Linux servers, Windows laptops, and ARM instances without recompiling for each platform.
Classes, interfaces, and packages model domain boundaries. Enterprise frameworks assume encapsulation, polymorphism, and clear APIs.
Maven Central, mature drivers, and first-class clients for Kafka, cloud SDKs, and databases—if it runs in enterprise, there is a Java library.
Fortune 500 backends, payment rails, and telco cores run on Java. Long-Term Support releases (11, 17, 21) align with multi-year operations contracts.
Compile-time checks catch large classes of defects before deploy. Generics, records, and sealed types push correctness without giving up expressiveness.
Milestones from the first public release to today’s LTS. Enterprises standardize on LTS versions (11, 17, 21); feature releases ship every six months.
Oak goes public at Sun. Applets, public static void main, and the JVM model that still defines the platform.
Java 2 rebranding: J2SE for desktop and server runtime, J2EE for servlets, EJB, and enterprise XML. Collections framework (1.2), assertions (1.4).
List<T>, enums, annotations, varargs, and java.util.concurrent. Generics change how every API is written.
Functional interfaces, Stream API, Optional, new date/time, and default methods on interfaces—the dialect most codebases still use daily.
Six-month release cadence begins. HTTP Client API, var in local variables (10), modular JDK, and the shift to multiple JDK vendors (Adoptium, Corretto, etc.).
Records, sealed classes, pattern matching for instanceof, stronger encapsulation of JDK internals—widely adopted as the “modern baseline.”
Project Loom: platform threads vs virtual threads for massive I/O concurrency. Pattern matching for switch, record patterns, sequenced collections.
Fifteen deep-dive chapters plus cheat sheets. Recommended path: JVM → Fundamentals → OOP → Collections, then advanced topics as your role requires.
Learning path: JVM & Platform · Language Fundamentals · OOP · Collections · Generics · Streams · Concurrency
Syntax, OOP basics, collections, exceptions, testing intro.
Generics, streams, concurrency, I/O, networking, design patterns.
JVM tuning, performance, modern Java, architecture-level patterns.
Class loaders, heap, GC, JIT, diagnostic tools.
Types, operators, control flow, strings, casting.
Classes, inheritance, interfaces, records, equals/hashCode.
List, Set, Map internals and iterators.
Wildcards, PECS, erasure, bounded types.
Checked vs unchecked, try-with-resources.
Lambdas, Optional, Stream API, Collectors.
JMM, locks, executors, virtual threads.
Modules, records, pattern matching, Loom.
GoF patterns in idiomatic Java + Spring.
Streams, channels, Path API, serialization risks.
Sockets, HttpClient, WebSocket.
JUnit 5, Mockito, test pyramid, coverage.
JMH, JFR, async-profiler, heap analysis.
Dense references per persona.
Every Java program is a class with a main method. The JVM loads the class, invokes main, and executes bytecode on the heap with a stack frame per method call.
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, Java Core!");
}
}
| Token | What it means |
|---|---|
public |
Access modifier—the class is visible outside its package. The launcher must see main. |
class |
Declares a reference type. Keywords cannot be used as identifiers. |
HelloWorld |
Class name (PascalCase). Source file must be HelloWorld.java. |
{ … } |
Class body—fields, methods, and nested types live inside the braces. |
public static void main |
static — no object exists yet. void — returns nothing. main — JVM entry point name. |
(String[] args) |
Parameter: array of command-line arguments (java HelloWorld arg1 arg2). |
System.out |
System is a final class; out is the standard output PrintStream. |
println(...) |
Prints the string plus a newline. print omits the newline. |
"Hello, Java Core!" |
String literal—immutable String object (often interned in the string pool). |
; |
Statement terminator—required at the end of each statement in Java. |
Run a single source file without a manual compile step: java HelloWorld.java Java 11+. Projects use Maven or Gradle (see ecosystem map).
Filename ≠ public class name → compile error. Non-public class with main in another package → “Main method not found in class” at runtime.
Three names confuse newcomers: you write with the JDK, historically ran with a JRE, and always execute on the JVM. Modern JDK downloads bundle all three for deployment and development.
┌──────────────────────────────────────────────────────────────────┐ │ JDK — Java Development Kit (what developers install) │ │ ┌────────────────────────────────────────────────────────────┐ │ │ │ JRE — Java Runtime Environment (libraries + JVM concept) │ │ │ │ ┌──────────────────────────────────────────────────────┐ │ │ │ │ │ JVM — executes bytecode, GC, JIT, native interface │ │ │ │ │ └──────────────────────────────────────────────────────┘ │ │ │ │ Core class libraries (java.*, javax.*) │ │ │ └────────────────────────────────────────────────────────────┘ │ │ Development tools: javac, jar, javadoc, jshell, jlink, jdeps │ └──────────────────────────────────────────────────────────────────┘
Full kit: compiler (javac), tooling, libraries, and JVM. Required on CI build agents and developer machines.
Runtime only—no compiler. Oracle stopped shipping a separate JRE after Java 8; use a slim JRE distribution or container image with just what you need.
Executes .class bytecode. Implementations: HotSpot (OpenJDK default), GraalVM, Eclipse OpenJ9. Tuned with -Xmx, GC flags, etc.
javac emits bytecode, not native code. HotSpot interprets cold methods, then JIT-compiles hot paths—why micro-benchmarks need warmup and why production JVM flags matter.
A typical Spring Boot service: Gradle build → fat JAR → container with a Java 21 runtime → G1 GC flags → JUnit + Mockito in CI → Hibernate to PostgreSQL. Java Core chapters map directly to each layer.