Class Reference
130 essential JDK classes, curated — key methods, examples, and pitfalls, with links to the official Javadoc.
Language Core (java.lang)
- CObjectjava.langRoot of the hierarchy: equals, hashCode, toString, and monitor methods
- CStringjava.langImmutable UTF-16 text — pooled literals, rich API, equals not ==
- CStringBuilderjava.langMutable buffer for efficient incremental string construction
- CIntegerjava.langint box + parsing, comparison, and bit utilities; caches −128…127
- CLongjava.lang64-bit box with parsing and unsigned helpers
- CDoublejava.langdouble box + IEEE-754 utilities (NaN tests, bits)
- CBooleanjava.langboolean box with two cached instances and lenient parsing
- CCharacterjava.langchar box and Unicode classification/code-point utilities
- CMathjava.langmin/max/abs, powers, rounding, and overflow-checked *Exact methods
- CSystemjava.langStandard streams, properties/env, nanoTime, arraycopy
- CRuntimejava.langJVM handle: processors, memory figures, shutdown hooks
- CThreadjava.langA thread of execution — builders, interruption, lifecycle states
- CThreadLocaljava.langPer-thread variable storage (mind pools and virtual threads)
- CThrowablejava.langRoot of all thrown things: message, cause chain, stack trace
- CExceptionjava.langChecked-exception root — recoverable, declared failures
- CRuntimeExceptionjava.langUnchecked root — programming errors and violated preconditions
- CEnumjava.langImplicit enum superclass: name(), ordinal(), singleton constants
- CRecordjava.langImplicit record superclass — transparent immutable data carriers
- CClassjava.langRuntime type token and the gateway to reflection
- IIterablejava.langThe for-each contract: provides an Iterator
- IComparablejava.langNatural ordering via compareTo
- IRunnablejava.langA no-arg, no-result task for threads and executors
- IAutoCloseablejava.langThe try-with-resources contract: close() managed for you
- CObjectsjava.utilNull-safe equals/hash/toString and requireNonNull precondition checks
Collections (java.util)
- ICollectionjava.utilRoot container contract: add, remove, contains, iterate, stream
- IListjava.utilOrdered, indexed sequence allowing duplicates
- CArrayListjava.utilGrowable array — the default List, cache-friendly and O(1) by index
- CLinkedListjava.utilDoubly-linked List/Deque — rarely the right choice in practice
- ISetjava.utilNo duplicates, as judged by equals
- CHashSetjava.utilHash-table Set: O(1) membership, arbitrary order
- CLinkedHashSetjava.utilHashSet with predictable insertion-order iteration
- CTreeSetjava.utilSorted set with floor/ceiling/range navigation queries
- IMapjava.utilKey → value associations with the modern compute/merge API
- CHashMapjava.utilThe default map: hashed buckets, O(1) operations, treeified collisions
- CLinkedHashMapjava.utilOrdered HashMap; access-order mode + removeEldestEntry = LRU cache
- CTreeMapjava.utilRed-black-tree map: sorted keys, nearest-key and range queries
- IQueuejava.utilHead-first holding collection: offer/poll/peek vs add/remove/element
- IDequejava.utilDouble-ended queue — the modern Stack and Queue in one
- CArrayDequejava.utilCircular-array Deque: the right default stack AND queue
- CPriorityQueuejava.utilBinary heap: poll() always yields the minimum
- IIteratorjava.utilThe cursor protocol; iterator.remove() is CME-safe removal
- IComparatorjava.utilExternal ordering with comparing/thenComparing/reversed combinators
- CCollectionsjava.utilStatic algorithms (sort, shuffle, binarySearch) and wrapper views
- CArraysjava.utilRaw-array utilities: sort, copyOf, equals, toString, stream
- CEnumMapjava.utilArray-backed map for enum keys — always prefer over HashMap (EJ 37)
- CEnumSetjava.utilBit-vector set of enum constants — the type-safe flag field (EJ 36)
- CWeakHashMapjava.utilEntries vanish when keys become weakly reachable
- COptionaljava.utilMaybe-value return type: orElse, map, ifPresent — never bare get()
- ISortedSetjava.utilSet kept in ascending order — first/last and range views
- INavigableSetjava.utilSortedSet + ceiling/floor navigation and descending views
- ISortedMapjava.utilMap with keys in ascending order — endpoint and range views
- INavigableMapjava.utilSortedMap + nearest-key/entry navigation and descending views
- ISequencedCollectionjava.utilJava 21: first/last access and a reversed view over an ordered collection
- ISequencedMapjava.utilJava 21: first/last entries, put-at-end, and reversed views for maps
- IListIteratorjava.utilBidirectional list cursor that can add/set/remove in place
- ISpliteratorjava.utilSplit-and-traverse primitive powering the Stream API
- IEntryjava.util.MapA key/value pair — entrySet element and comparator factories
Functional & Streams
- IStreamjava.util.streamLazy pipeline: map/filter/flatMap + one terminal operation
- IIntStreamjava.util.streamPrimitive int pipeline: range(), sum(), average() — no boxing
- CCollectorsjava.util.streamCollector recipes: toList/toMap, joining, groupingBy + downstreams
- IFunctionjava.util.functionT → R transformation with andThen/compose
- IBiFunctionjava.util.function(T, U) → R — the shape of Map.merge and compute
- IPredicatejava.util.functionT → boolean test with and/or/negate combinators
- IConsumerjava.util.functionT → void action — forEach bodies and callbacks
- ISupplierjava.util.function() → T lazy producer — deferred construction and defaults
- IUnaryOperatorjava.util.functionT → T same-type transform (List.replaceAll)
- IBinaryOperatorjava.util.function(T, T) → T combiner — the reduce/merge shape
Concurrency (java.util.concurrent)
- IExecutorServicejava.util.concurrentSubmit tasks, get Futures, shut down cleanly
- CExecutorsjava.util.concurrentFactories: fixed pools, scheduled, virtual-thread-per-task
- CThreadPoolExecutorjava.util.concurrentThe fully configurable pool: sizes, queue, rejection policy
- IScheduledExecutorServicejava.util.concurrentDelayed and periodic task execution
- IFuturejava.util.concurrentHandle to an async result: get, cancel, state
- CCompletableFuturejava.util.concurrentComposable promise: thenApply/thenCompose/allOf/exceptionally
- CConcurrentHashMapjava.util.concurrentThe concurrent map: lock-free reads, atomic compute/merge
- CConcurrentSkipListMapjava.util.concurrentConcurrent sorted map — TreeMap's lock-free cousin
- CCopyOnWriteArrayListjava.util.concurrentSnapshot-iterating list for read-mostly listener registries
- IBlockingQueuejava.util.concurrentput/take producer-consumer conveyor with backpressure
- CArrayBlockingQueuejava.util.concurrentBounded array-backed blocking queue
- CLinkedBlockingQueuejava.util.concurrentLinked blocking queue — unbounded by default, beware
- CCountDownLatchjava.util.concurrentOne-shot gate: await until N countDowns
- CCyclicBarrierjava.util.concurrentReusable rendezvous for N parties per generation
- CSemaphorejava.util.concurrentPermit counter bounding concurrent access to a resource
- CReentrantLockjava.util.concurrent.locksExplicit lock: tryLock, timeouts, interruptible, fair
- CReentrantReadWriteLockjava.util.concurrent.locksShared read lock + exclusive write lock
- CStampedLockjava.util.concurrent.locksOptimistic reads via stamps — expert-tier, non-reentrant
- CAtomicIntegerjava.util.concurrent.atomicLock-free int: CAS, incrementAndGet, updateAndGet
- CAtomicLongjava.util.concurrent.atomicLock-free 64-bit counter
- CAtomicReferencejava.util.concurrent.atomicCAS over object references — swap immutable snapshots
- CLongAdderjava.util.concurrent.atomicContention-striped counter — beats AtomicLong when hot
- CForkJoinPooljava.util.concurrentWork-stealing pool behind parallel streams and async defaults
- ETimeUnitjava.util.concurrentTime granularities for timeouts, with conversions
I/O, Files & Networking
- CInputStreamjava.ioAbstract byte source: read() 0–255 or −1; buffer it
- COutputStreamjava.ioAbstract byte sink: write, flush, close
- CReaderjava.ioAbstract character source — bytes decoded via a Charset
- CWriterjava.ioAbstract character sink
- CBufferedReaderjava.ioBuffered text reading: readLine() and lines()
- CPrintWriterjava.ioFormatted text output: println/printf (errors via checkError)
- CScannerjava.utilTokenizing parser: nextInt/nextLine (mind the newline gotcha)
- IPathjava.nio.fileImmutable location with resolve/relativize/normalize algebra
- CFilesjava.nio.fileAll file operations: read/write, copy/move, walk, metadata
- CByteBufferjava.nioposition/limit/capacity byte container — fill, flip, drain
- CFileChanneljava.nio.channelsBlock I/O: positional reads, memory mapping, zero-copy transfer
- CStandardCharsetsjava.nio.charsetGuaranteed charsets — UTF_8 as an explicit constant
- CSocketjava.netTCP client connection — always set connect and read timeouts
- CServerSocketjava.netTCP listener: accept() loop, one worker per connection
- CURIjava.netParsed, immutable resource identifier
- CHttpClientjava.net.httpModern HTTP: HTTP/2, pooling, sync or async — build once, share
- CHttpRequestjava.net.httpImmutable request: method, URI, headers, timeout, body publisher
- IHttpResponsejava.net.httpStatus, headers, and a typed body — non-2xx does not throw
- CPatternjava.util.regexCompiled regex — hoist to a static final constant
- CMatcherjava.util.regexMatching engine: matches/find, groups, replaceAll
Time, Math & Platform
- CLocalDatejava.timeCalendar date without time or zone
- CLocalTimejava.timeWall-clock time without date or zone
- CLocalDateTimejava.timeDate + time without zone — a reading, not a moment
- CZonedDateTimejava.timeFull moment with DST-aware zone rules
- CInstantjava.timePoint on the UTC timeline — THE timestamp type
- CDurationjava.timeMachine-time span: timeouts and elapsed measurement
- CPeriodjava.timeCalendar span in years/months/days
- CZoneIdjava.timeIANA zone id with full DST rule history
- CDateTimeFormatterjava.time.formatThread-safe formatting/parsing — SimpleDateFormat's successor
- CClockjava.timeInjectable time source — fixed clocks make time testable
- CBigDecimaljava.mathExact decimal arithmetic — the money type; compare with compareTo
- CBigIntegerjava.mathArbitrary-size integers for crypto and combinatorics
- CUUIDjava.util128-bit unique identifiers via randomUUID()
- CRandomjava.utilSeedable pseudo-random — reproducible tests, never secrets
- CThreadLocalRandomjava.util.concurrentContention-free randomness for concurrent code
- CSecureRandomjava.securityCryptographically strong randomness: tokens, salts, IVs
- CProcessBuilderjava.langSpawn OS processes with wired streams — no shell injection
- CLocalejava.utilLanguage + region driving all locale-sensitive behavior
- CServiceLoaderjava.utilDiscover registered implementations — plugin wiring