Language

Java

First appeared
1995
Paradigm
Object-oriented, imperative, statically typed
Toolchain
OpenJDK 21
Container image
debian:trixie-20261027-slim + openjdk-21-jdk-headless 21.0.12.1

Java came out of Sun Microsystems in 1995 with the promise “write once, run anywhere”: it compiles to bytecode for the Java virtual machine, not for one kind of processor. It’s one of the most-used languages in the world, mostly in business systems and Android apps. Data science reaches it through the big-data tools built on the JVM, such as Hadoop, Spark, and Kafka.

Its standard library is large, with collections, streams, and file and date handling, but it has no statistics or matrices, so the methods here are written out by hand. The implementations use no build tool and no third-party library: each is one file, compiled with javac and run with java. Libraries such as Apache Commons Math aren’t installed.

Quirks

Concepts in Java

Run the examples locally

You need Docker and Python 3. The harness builds the pinned container and runs every Java example:

git clone https://github.com/qnixon/dswithx.git
cd dswithx
python3 harness/run_tests.py --language java