Category Archives: 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 … Continue reading

Posted in effective 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 … Continue reading

Posted in effective java, java