-
Skeletal implementation
How to stop copy-pasting interface methods
-
Understanding Comparable and Comparator - with examples
The compareTo() contracts, the overflow trap, consistency with equals, and choosing between Comparable and Comparator - with code examples and interview questions.
-
Everything you need to know about clone() and Cloneable
The contracts, shallow copy, deep copy, and copy constructors - explained with code examples and interview questions.
-
What hides behind the (31 * x + y) formula in hashCode()?
Why Java picked 31 for hashCode(), what breaks without the multiplier, and how HashMap compensates for the formula on its own side.