ReviseAlgo Logo

Introduction to Java

History of Java

The history and evolution of Java from Sun Microsystems' Oak language to modern Oracle Java 21 LTS, detailing major feature milestones.

Interview: Useful for senior interviews to show depth of language knowledge (e.g., choosing Java 8 vs 11 vs 17 vs 21 features).

Last Updated: June 13, 2026 10 min read

Java was initiated by James Gosling, Mike Sheridan, and Patrick Naughton (collectively known as the "Green Team") at Sun Microsystems in 1991. Initially called "Oak" (after an oak tree outside Gosling's office), it was rebranded to "Java" in 1995 and has evolved from a tool for interactive television into the backbone of corporate enterprise web architectures.

Core Idea

Java's history is characterized by constant modernization combined with a strict commitment to backwards compatibility.

Why It Matters

Knowing the history tells you why certain patterns (like modern lambdas or records) replace older, verbose boilerplate constructs.

Interview Lens

Expect questions on legacy vs modern structures, generic type erasure decisions, and the benefits of virtual threads over OS threads.

Major Milestones

  • JDK 1.0 (1996): First public release, introducing the WORA execution philosophy and basic libraries.
  • JDK 1.2 / Java 2 (1998): Introduction of the Collections Framework (List, Map, Set) replacing Vector/Hashtable.
  • Java 5 (2004 - Landmark release): Generics (type safety for collections), Enums, Autoboxing/Unboxing, Annotations, Varargs, and Enhanced For-Loop.
  • Java 8 (2014 - Functional Revolution): Lambda Expressions, Streams API, java.time package (Joda-Time replacement), and Optional.
  • Java 9 (2017): Module System (Project Jigsaw) to break the monolithic JDK into smaller dependencies.
  • Java 11 (2018 LTS): Local-Variable Type Inference (var) inside lambdas, HTTP Client API.
  • Java 17 (2021 LTS): Sealed classes, Pattern Matching for switch (preview), Records finalized.
  • Java 21 (2023 LTS - Modern Concurrency): Virtual Threads (Project Loom) for high-throughput lightweight threads, Sequenced Collections, Record Patterns.

Detailed Explanation

Java was originally created to solve a problem in interactive television systems: building software that could run on heterogeneous home devices. The C++ compiler proved too risky and fragile due to system-level pointers and manual memory allocation. The team decided to build a platform-independent runtime.

Initially, Sun released Java with a sluggish interpreter. As enterprise web systems expanded, Java evolved. In 2010, Oracle acquired Sun Microsystems, changing the development landscape. Oracle transitioned Java to a strict 6-month release cadence, with Long-Term Support (LTS) versions released every 2 years.

Historical Feature Evolution

Version Year Key Value Added
Java 5 2004 Type-safe Collections via Generics
Java 8 2014 Functional programming & Parallel Pipelines
Java 17 2021 Immutability structures (Records, Sealed Classes)
Java 21 2023 Scalable Concurrency (Virtual Threads)

Common Pitfalls

  • Using Obsolete API Classes: Using legacy classes like java.util.Date, Vector, or Hashtable. Modern codebases must use the java.time package and the newer Collections frameworks.
  • Assuming JavaScript and Java are Related: They are fundamentally different languages. JavaScript is a dynamically-typed scripting language; Java is a statically-typed class-based language.

Best Practices

  • Upgrade along LTS Paths: Move legacy environments systematically through LTS checkpoints (Java 8 -> Java 11 -> Java 17 -> Java 21) rather than jumping across experimental releases.
  • Prefer Records for Data Holders: Use Java 16+ records instead of boilerplate classes with getters/setters/equals/hashCode.

Interview-Relevant Information

Q1: What is type erasure in Generics? (Java 5 feature)
Answer: To maintain backwards compatibility with pre-Java 5 bytecodes, generic type parameters are removed (erased) by the compiler, replaced with Object or bound types, and cast dynamically. This means generic type parameters do not exist at runtime.

Q2: Why was Java 8 considered a paradigm shift?
Answer: It introduced lambda expressions and functional interfaces, enabling developers to write declarative, pipeline-based expressions (Streams API) instead of imperative state-mutating loops.

Q3: How do Virtual Threads in Java 21 differ from classic Platform Threads?
Answer: Platform threads map 1:1 to OS-level kernel threads, which are expensive and limited. Virtual threads are managed by the JVM and run on top of a carrier pool, allowing millions of concurrent threads to execute I/O-bound tasks with minimal overhead.

Quick Checklist

Can you state Java's release frequency, identify the core feature of Java 5, Java 8, and Java 21, and explain the concept of type erasure? If so, you understand Java's evolution.

Use Cases

Choosing the right LTS release (e.g., JDK 17 vs 21) based on concurrency requirements.

Refactoring verbosely written legacy pre-Java 8 loops into modern streams and lambdas.

Using Records to simplify code for DTOs in REST controllers.

Common Mistakes

Mixing old Joda-Time or java.util.Date APIs with java.time APIs, causing parsing discrepancies.

Deploying virtual threads for heavy CPU-bound tasks, which can block JVM carrier threads.