Cheatsheet: Java
Last updated 2026-08-15
Variables and Types
Primitives and objects
Type inference with var
Records for simple data
Control Flow
if / else
for and enhanced for
switch expression
while loop
Collections
List
Map
Set
Classes and Objects
Class with constructor
Inheritance
Interface implementation
Streams and Lambdas
Filter and map
Collectors
Method references
Exception Handling
try / catch / finally
Checked vs unchecked
try-with-resources
String Formatting
String.format
Formatted strings
Text blocks