objects and classes
classes, constructors, inheritance, polymorphism, interfaces, and the contracts every object signs.
- 01classes and objectsa class is a blueprint, new stamps out an object. what's actually in memory.
- 02constructors and init orderthe exact order fields, initializers and constructors run in.
- 03access controlprivate, package-private, protected, public. who can see what.
- 04staticone copy per class vs one copy per object.
- 05packages and importsfully qualified names, the classpath, and import module.
- 06inheritanceextends, super, and how a subclass object is laid out in memory.
- 07polymorphism and dynamic dispatchoverloading picks at compile time, overriding picks at runtime. the vtable.
- 08abstract classes and interfacesdefault methods, the diamond problem, and when to use which.
- 09equals, hashCode, toStringthe contracts every object signs, and what breaks when you don't keep them.
- 10enumstype-safe constants that are secretly full classes.
- 11nested and inner classesstatic nested, inner, local, anonymous. and the hidden this$0.
- 12immutabilityfinal fields, defensive copies, and the aliasing bug that ruins your day.
- 13composition over inheritancethe fragile base class problem, animated.