| 姓名:(美)布洛克著 作者简介: 作品:《Effective Java (第2版)(英文版)》《Java解惑》 姓名:(美国)布洛克(Bloch.J.)著 作者简介: 作品:《Effective Java (第2版)(英文版)》 |
1 introduction 2 creating and destroying objects item 1: consider static factory methods instead of constructors item 2: consider a builder when faced with many constructor parameters item 3: enforce the singleton property with a private constructor or an enum type item 4: enforce noninstantiability with a private constructor item 5: avoid creating unnecessary objects item 6: eliminate obsolete object references item 7: avoid finalizers 3 methods common to all objects item 8: obey the general contract when overriding equals item 9: always override hashcode when you overrideequals item 10: always override tostring item 11: override clone judiciously item 12: consider implementing comparable 4 classes and interfaces item 13: minimize the accessibility of classes and members item 14: in public classes, use accessor methods, not public fields item 15: minimize mutability item 16: favor composition over inheritance ite 更多 |
商品评论(0条)