Java is a class-based, object-oriented programming language designed for write once, run anywhere (WORA) portability through the Java Virtual Machine (JVM). Originally released in 1995, Java combines strong static typing with automatic memory management, making it a foundation for enterprise applications, Android development, and distributed systems. The language prioritizes readability, stability, and backward compatibility, allowing decades-old code to run on modern JVMs. As of Java 25 (LTS, September 2025) and Java 26 (March 2026), the language continues to evolve rapidly with virtual threads, records, pattern matching, sealed classes, stream gatherers, scoped values, and HTTP/3 support, making it one of the most actively developed platforms in the industry.
What This Cheat Sheet Covers
This topic spans 28 focused tables and 284 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Primitive Data Types
Java's eight primitives are the only values that aren't objects — they hold raw numbers, characters, and booleans directly rather than as references. The practical advice is short: reach for int and double by default, and only drop to long, byte, or float when range, binary handling, or memory genuinely calls for it.
| Type | Example | Description |
|---|---|---|
int count = 100; | • 32-bit signed integer • default choice for whole numbers • range approximately ±2.1 billion. | |
long big = 9876543210L; | • 64-bit signed integer • requires L suffix • used for timestamps, large counts, or IDs. | |
double price = 99.99; | • 64-bit floating-point • default for decimal numbers • preferred for scientific calculations. | |
boolean active = true; | • Logical type holding true or false • no implicit conversion to integers. |