effective java

Methods Common to All Objects :effective java ch3

Item 7: Obey the general contract when overriding equals Item 8: Always override hashCode when you override equals Item 9: Always override toString Item 10: Override clone judiciously Item 11: Consider implementing Comparable ———————————————————————————————————————————————————————– Item 7: Obey the general contract when overriding equals (override equal rules) Putting it all together, here’s a recipe for a… Continue reading Methods Common to All Objects :effective java ch3

effective java · java

Creating and Destroying Objects:effective java ch2

Chapter 2. Creating and Destroying Objects Item 1: Consider providing static factory methods instead of constructors Item 2: Enforce the singleton property with a private constructor Item 3: Enforce noninstantiability with a private constructor Item 4: Avoid creating duplicate objects Item 5: Eliminate obsolete object references Item 6: Avoid finalizers Item 1: Consider providing static… Continue reading Creating and Destroying Objects:effective java ch2