Java Cheatsheet

A quick-reference guide for working Java developers.

Collections

Lists, Sets, Maps, Queues — the non-concurrent collection classes, their trade-offs, and time complexities.

Concurrent Collections

Thread-safe collections from java.util.concurrent — ConcurrentHashMap, blocking queues, copy-on-write lists, and more.

Modern Java

Records, sealed interfaces, pattern matching, and lambdas — the features that make modern Java expressive.

Threading Primitives

synchronized, volatile, locks, conditions, and atomic classes — low-level concurrency building blocks.

Executors & Thread Pools

Thread pools, ExecutorService, Future, CompletableFuture — structured concurrency at a higher level.

Virtual Threads

Project Loom's lightweight threads — scalable concurrency without the complexity of reactive programming.

Spring Boot

Annotations, auto-configuration, dependency injection, REST controllers, data access, and testing essentials.