# Java Language Reference
## Languages — The Codex Coding
**URL:** https://thecodex.expert/coding/languages/java/
**Type:** language-reference | **Confidence:** high | **Last verified:** 2026-06-01

## CANONICAL DEFINITION
Java is a statically typed, class-based, object-oriented programming language that compiles to platform-independent bytecode executed by the Java Virtual Machine (JVM), providing automatic memory management, true multi-threading, and a comprehensive standard library — the dominant language for enterprise software and Android development.

## QUICK FACTS
- **Created:** 1995 by James Gosling at Sun Microsystems
- **Current:** Java 23 (September 2024)
- **LTS:** Java 21 (September 2023) — use for production
- **Typing:** Static, strong — types declared at compile time
- **Execution:** Compiled to JVM bytecode, JIT compiled by HotSpot
- **Memory:** GC (G1 default, ZGC for low latency, Shenandoah)
- **Concurrency:** True multi-threading + virtual threads (Java 21, JEP 444)

## CRITICAL QUIRKS
- `==` on objects compares references — use `.equals()` always
- `Integer.valueOf(200) == Integer.valueOf(200)` is FALSE (not cached)
- Generics use type erasure — no `instanceof List<String>` at runtime
- Checked exceptions (IOException etc.) must be declared or caught
- String is immutable — never concatenate in a loop, use StringBuilder
- Java and JavaScript are completely unrelated — naming coincidence only

## VERSION MILESTONES
- Java 5 (2004): generics, autoboxing, enums, annotations
- Java 8 (2014): lambdas, Streams, Optional, default interface methods [LTS]
- Java 11 (2018): HTTP client, var in lambdas [LTS]
- Java 17 (2021): sealed classes, text blocks [LTS]
- Java 21 (2023): virtual threads (Project Loom), pattern matching switch [LTS]
- Java 23 (2024): unnamed classes preview

## KEY ECOSYSTEM
- Build tools: Maven, Gradle
- Frameworks: Spring Boot (dominant), Quarkus, Micronaut
- Testing: JUnit 5, Mockito, AssertJ
- Modern JVM alternative: Kotlin (preferred for Android)

## SOURCES
- Java Language Specification: docs.oracle.com/javase/specs/
- Effective Java (Bloch, 2018): canonical best practices
- JEP 444 Virtual Threads: openjdk.org/jeps/444

*The Codex Coding — thecodex.expert/coding/ — Free forever — Mumbai, India*
