Core APIs
The JDK's core classes are the workhorses of daily Java development.
Object,String,Math, the wrapper types, andOptionalappear in almost every codebase. Getting fluent with their contracts — especiallyequals/hashCodeandOptional's anti-patterns — prevents a category of bugs that are otherwise hard to trace.
What You'll Find Here
Notes are being added. Planned topics:
| Topic | Description |
|---|---|
| Object Class | equals, hashCode, toString, clone, wait/notify. |
| String, StringBuilder, StringJoiner | Text processing APIs — immutability, pool, builder pattern. |
| Math & StrictMath | abs, pow, floor, overflow-safe arithmetic methods. |
| Wrapper Classes | Integer, Long, Double; parseInt, caching gotcha with ==. |
| Optional (Java 8+) | Nullable-value container; proper use and common anti-patterns. |
Learning Path
- Object Class — the
equals/hashCodecontract is foundational; violating it breaks collections. - String & StringBuilder — understand immutability and when to use
StringBuilderover+. - Wrapper Classes — focus on the
Integer.valueOf(-128..127)caching trap and its==implication. - Optional — learn what it solves, then learn what it does NOT solve (never use as a field or parameter).
Related Domains
- Core Java — introduces
Stringand primitive types. - Collections Framework —
equals/hashCodefromObjectgovernsHashMapandHashSetbehavior. - Java Type System — wrapper classes interact with autoboxing.