Chapter 3. Methods Common to All Objects(对象的通用方法) 本章将告诉你何时以及如何覆盖 Object 类的非 final 方法。虽然 Comparable.compareTo 不是 Object 类的方法,但是由于具有相似的特性,所以本章也对它进行讨论 Item 10: Obey the general contract when overriding equals(覆盖 equals 方法时应遵守的约定) Item 11: Always override hashCode when you override equals(当覆盖 equals 方法时,总要覆盖 hashCode 方法) Item 12: Always override toString(始终覆盖 toString 方法) Item 13: Override clone judiciously(明智地覆盖 clone 方法) Item 14: Consider implementing Comparable(考虑实现 Comparable 接口)