Skip to main content

Core APIs

The JDK's core classes are the workhorses of daily Java development. Object, String, Math, the wrapper types, and Optional appear in almost every codebase. Getting fluent with their contracts — especially equals/hashCode and Optional'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:

TopicDescription
Object Classequals, hashCode, toString, clone, wait/notify.
String, StringBuilder, StringJoinerText processing APIs — immutability, pool, builder pattern.
Math & StrictMathabs, pow, floor, overflow-safe arithmetic methods.
Wrapper ClassesInteger, Long, Double; parseInt, caching gotcha with ==.
Optional (Java 8+)Nullable-value container; proper use and common anti-patterns.

Learning Path

  1. Object Class — the equals/hashCode contract is foundational; violating it breaks collections.
  2. String & StringBuilder — understand immutability and when to use StringBuilder over +.
  3. Wrapper Classes — focus on the Integer.valueOf(-128..127) caching trap and its == implication.
  4. Optional — learn what it solves, then learn what it does NOT solve (never use as a field or parameter).