Language Deep Dive

Java

"Write once, run anywhere." Three decades on, Java still powers more bank vaults, airline reservations, and Android phones than any other language.

OOPStatically TypedJVMGarbage CollectedEnterprise
← Back to Server Side
Quick Facts

At a Glance

Created
1995 · Sun Microsystems
Designed by
James Gosling
Paradigm
OOP, multi-paradigm
Typing
Static, strong
Runtime
JVM (bytecode)
Memory
Garbage collected
Latest LTS
Java 21 / 25
Steward
Oracle / OpenJDK

Basic Concepts

  • Source → Bytecode → JVM: javac compiles .java to .class bytecode that any JVM runs.
  • Class-based OOP: everything lives inside a class.
  • Strong typing & explicit declarations mean the compiler catches many bugs early.
  • Memory: garbage collector frees you from malloc/free; pause times are tunable.
  • Massive standard library for collections, IO, networking, concurrency.
Syntax

Taste of Java

public class Hello {
    public static void main(String[] args) {
        System.out.println("Hello, world!");
    }
}

// A small domain class with modern Java features
public record Customer(String name, int age) {
    public boolean isAdult() { return age >= 18; }
}

List<Customer> adults = customers.stream()
    .filter(Customer::isAdult)
    .toList();
Mechanics

Key Features

The JVM & Bytecode

Java compiles to portable bytecode that the JVM executes. The JVM does just-in-time compilation — hot code is converted to optimized native machine code at runtime. Other languages (Kotlin, Scala, Clojure, Groovy) ride on the JVM too.

Concurrency & Virtual Threads

Java has had Thread, executor pools, and java.util.concurrent for decades. Java 21 added virtual threads — millions of lightweight threads on top of a small pool of OS threads, hugely simplifying concurrent server code.

Generics & Collections

Type-safe containers like List<Customer>, Map<String, Integer>. The Streams API (Java 8+) gives functional-style pipelines on collections.

Modern Language Additions
  • Records — concise immutable data classes.
  • Pattern matching in switch and instanceof.
  • Sealed classes — closed type hierarchies.
  • Text blocks — multi-line strings.
  • var — local-variable type inference.
Tooling Ecosystem
CategoryTools
BuildMaven, Gradle
IDEIntelliJ IDEA, Eclipse, VS Code, NetBeans
TestJUnit 5, TestNG, Mockito, AssertJ
Web frameworksSpring Boot, Quarkus, Micronaut, Helidon, Jakarta EE
PersistenceJPA / Hibernate, jOOQ, MyBatis
ReactiveProject Reactor, RxJava
Trade-offs

Strengths & Weaknesses

Strengths
  • Battle-tested at extreme scale; world-class GC and JIT.
  • Vast hiring pool and library ecosystem.
  • Backward compatibility — code from 2005 still runs.
  • Best-in-class IDEs and refactoring tools.
Weaknesses
  • Verbose by modern standards (improving fast).
  • JVM startup cost & memory footprint (mitigated by GraalVM, native image).
  • Historical reputation for over-engineered "enterprise" code.
Where It Shines

Sweet Spots

Banking & Finance

Core banking, trading, settlement, fraud detection.

Large Enterprise Backend

SaaS, ERP, supply chain — Spring Boot is everywhere.

Android (via Kotlin)

Android originally Java; Kotlin is now preferred but interoperates.

Big Data

Hadoop, Spark, Kafka, Elasticsearch — all JVM under the hood.

Continue

Other Languages