Java Classes and Objects: OOP From Scratch
Design Java classes that hold state and behavior cleanly. Constructors, encapsulation, static vs instance, records, and the equals plus hashCode contract.
10 posts.
Design Java classes that hold state and behavior cleanly. Constructors, encapsulation, static vs instance, records, and the equals plus hashCode contract.
Pick the right Java collection by performance and semantics. ArrayList vs LinkedList, HashMap vs TreeMap, immutability, and iteration without surprises.
Every branching and looping construct in modern Java, including switch expressions and pattern matching, with examples that mirror real code.
Throw, catch, and chain exceptions without leaking abstractions. Checked vs unchecked, try with resources, custom exceptions, and rules that scale.
Write Java generics that compile and read well. Type parameters, bounded wildcards, PECS, type erasure, and how to avoid raw types in your own code.
Use extends, super, and method overriding without painting yourself into a corner. When to inherit, when to compose, and how sealed types help.
Install a modern JDK, verify the toolchain, and ship your first Java program from the command line without an IDE doing the magic for you.
Choose between interfaces and abstract classes with confidence. Default methods, sealed interfaces, functional interfaces, and concrete decision rules.
Transform collections with lambdas and the Stream API. Map, filter, reduce, collectors, parallel streams, and the pitfalls of lazy pipelines.
Master Java primitives, reference types, literals, and casting. Know exactly what each type costs and where overflow and precision will bite you.