_This is my summary of the Effective Java 2nd Edition by Joshua Bloch. I use it while learning and as quick reference. It is not intended to be an standalone substitution of the book so if you really want to learn the concepts here presented, buy and read the book and use this repository as a reference and guide._
_If you are the publisher and think this repository should not be public, just write me an email at hugomatilla \[at\] gmail \[dot\] com and I will make it private._
**Contributions:** Issues, comments and pull requests are super welcome :smiley:
# 1. TABLE OF CONTENTS
- [1. TABLE OF CONTENTS](#1-table-of-contents)
- [2. CREATING AND DESTROYING OBJECTS](#2-creating-and-destroying-objects)
- [1. Use STATIC FACTORY METHODS instead of constructors](#1-use-static-factory-methods-instead-of-constructors)
- [2. Use BUILDERS when faced with many constructors](#2-use-builders-when-faced-with-many-constructors)
- [3. Enforce the singleton property with a private constructor or an enum type](#3-enforce-the-singleton-property-with-a-private-constructor-or-an-enum-type)
- [4. Enforce noninstantiability with a private constructor](#4-enforce-noninstantiability-with-a-private-constructor)
- [5. Avoid creating objects](#5-avoid-creating-objects)
- [6. Eliminate obsolete object references](#6-eliminate-obsolete-object-references)
- [7. Avoid finalizers](#7-avoid-finalizers)
- [3. METHODS COMMON TO ALL OBJECTS](#3-methods-common-to-all-objects)
- [8. Obey the general contract when overriding _equals_](#8-obey-the-general-contract-when-overriding-equals)
- [9. Always override _hashCode_ when you override _equals_](#9-always-override-hashcode-when-you-override-equals)
- [10. Always override _toString_](#10-always-override-tostring)
- [11. Override _clone_ judiciously](#11-override-clone-judiciously)
- [12. Consider implementing _Comparable_](#12-consider-implementing-comparable)
- [4. CLASSES AND INTERFACES](#4-classes-and-interfaces)
- [13. Minimize the accessibility of classes and members](#13-minimize-the-accessibility-of-classes-and-members)
- [14. In public classes, use accessor methods, not public fields](#14-in-public-classes-use-accessor-methods-not-public-fields)
- [15. Minimize Mutability](#15-minimize-mutability)
- [16. Favor composition over inheritance](#16-favor-composition-over-inheritance)
- [17. Design and document for inheritance or else prohibit it.](#17-design-and-document-for-inheritance-or-else-prohibit-it)
- [18. Prefer interfaces to abstract classes](#18-prefer-interfaces-to-abstract-classes)
- [19. Use interfaces only to define types](#19-use-interfaces-only-to-define-types)
- [20. Prefer class hierarchies to tagged classes](#20-prefer-class-hierarchies-to-tagged-classes)
- [21. Use function objects to represent strategies](#21-use-function-objects-to-represent-strategies)
- [22. Favor static member classes over nonstatic](#22-favor-static-member-classes-over-nonstatic)
- [5. GENERICS](#5-generics)
- [23. Don't use raw types in new code](#23-dont-use-raw-types-in-new-code)
- [24. Eliminate unchecked warnings](#24-eliminate-unchecked-warnings)
- [25. Prefer lists to arrays](#25-prefer-lists-to-arrays)
- [26. Favor generic types](#26-favor-generic-types)
- [27. Favor generic Methods](#27-favor-generic-methods)
- [28. Use bounded wildcards to increase API flexibility](#28-use-bounded-wildcards-to-increase-api-flexibility)
- [29. Consider _typesafe heterogeneous containers_](#29-consider-typesafe-heterogeneous-containers)
- [6. ENUMS AND ANNOTATIONS](#6-enums-and-annotations)
- [30. Use enums instead of _int_ constants](#30-use-enums-instead-of-int-constants)
- [31. Use instance fields instead of ordinals](#31-use-instance-fields-instead-of-ordinals)
- [32. Use EnumSet instead of bit fields](#32-use-enumset-instead-of-bit-fields)
- [33. Use EnumMap instead of ordinal indexing](#33-use-enummap-instead-of-ordinal-indexing)
- [34. Emulate extensible enums with interfaces](#34-emulate-extensible-enums-with-interfaces)
- [35. Prefer annotations to naming patterns](#35-prefer-annotations-to-naming-patterns)
- [36. Consistently use the _Override_ annotation](#36-consistently-use-the-override-annotation)
- [37. Use marker interfaces to define types](#37-use-marker-interfaces-to-define-types)
- [7. METHODS](#7-methods)
- [38. Check parameters for validity](#38-check-parameters-for-validity)
- [39. Make defensive copies when needed.](#39-make-defensive-copies-when-needed)
- [40. Design method signatures carefully](#40-design-method-signatures-carefully)
- [41. Use overloading judiciously](#41-use-overloading-judiciously)
- [42. Use varargs judiciously](#42-use-varargs-judiciously)
- [43. Return empty arrays or collections, not nulls](#43-return-empty-arrays-or-collections-not-nulls)
- [44. Write _doc comments_ for all exposed API elements](#44-write-doc-comments-for-all-exposed-api-elemnts)
- [8. GENERAL PROGRAMMING](#8-general-programming)
- [45. Minimize the scope of local variables.](#45-minimize-the-scope-of-local-variables)
- [46. Prefer for-each loops to traditional for loops.](#46-prefer-for-each-loops-to-traditional-for-loops)
- [47. Know and use libraries](#47-know-and-use-libraries)
- [48. Avoid float and double if exact answer are required](#48-avoid-float-and-double-if-exact-answer-are-required)
- [49. Prefer primitive types to boxed primitives](#49-prefer-primitive-types-to-boxed-primitives)
- [50. Avoid Strings where other types are more appropriate](#50-avoid-strings-where-other-types-are-more-appropriate)
- [51. Beware the performance of string concatenation](#51-beware-the-performance-of-string-concatenation)
- [52. Refer to objects by their interface](#52-refer-to-objects-by-their-interface)
- [53. Prefer interfaces to reflection](#53-prefer-interfaces-to-reflection)
- [54. Use native methods judiciously](#54-use-native-methods-judiciously)
- [55. Optimize judiciously](#55-optimize-judiciously)
- [56. Adhere to generally accepted naming conventions](#56-adhere-to-generally-accepted-naming-conventions)
- [9. EXCEPTIONS](#9-exceptions)
- [57. Use exceptions only for exceptional conditions](#57-use-exceptions-only-for-exceptional-conditions)
- [58. Use checked exceptions for recoverable conditions and runtime exceptions for programming errors](#58-use-checked-exceptions-for-recoverable-conditions-and-runtime-exceptions-for-programming-errors)
- [59. Avoid unnecessary use of checked exceptions](#59-avoid-unnecessary-use-of-checked-exceptions)
- [60. Favor the use of standard exceptions](#60-favor-the-use-of-standard-exceptions)
- [61. Throw exceptions appropriate to the abstraction](#61-throw-exceptions-appropriate-to-the-abstraction)
- [62. Document all exceptions thrown by each method](#62-document-all-exceptions-thrown-by-each-method)
- [63. Include failure-capture information in detail messages](#63-include-failure-capture-information-in-detail-messages)
- [64. Strive for failure atomicity](#64-strive-for-failure-atomicity)
- [65. Don't ignore exceptions](#65-dont-ignore-exceptions)
- [10. CONCURRENCY](#10-concurrency)
- [66. Synchronize access to shared mutable data](#66-synchronize-access-to-shared-mutable-data)
- [67. Avoid excessive synchronization](#67-avoid-excessive-synchronization)
- [68. Prefer executors and tasks to threads](#68-prefer-executors-and-tasks-to-threads)
- [69. Prefer concurrency utilities to _wait_ and _notify_](#69-prefer-concurrency-utilities-to-wait-and-notify)
- [70. Document thread safety](#70-document-thread-safety)
- [71. Use lazy initialization judiciously](#71-use-lazy-initialization-judiciously)
- [72. Don't depend on thread scheduler](#72-dont-depend-on-thread-scheduler)
- [73. Avoid thread groups](#73-avoid-thread-groups)
- [11. SERIALIZATION](#11-serialization)
- [74. Implement _Serializable_ judiciously](#74-implement-serializable-judiciously)
没有合适的资源?快使用搜索试试~ 我知道了~
Joshua Bloch 所著《Effective Java 第二版》一书摘要.zip

共3个文件
txt:2个
md:1个

1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 75 浏览量
2024-11-25
00:50:03
上传
评论
收藏 37KB ZIP 举报
温馨提示
Joshua Bloch 所著《Effective Java 第二版》一书摘要这是我对 Joshua Bloch 所著《Effective Java 第 2 版》的总结。我在学习时会用到它,也可以作为快速参考。它并不是这本书的独立替代品,所以如果你真的想学习这里介绍的概念,请购买并阅读这本书,并将此存储库用作参考和指南。如果您是发布者并且认为该存储库不应公开,请给我发送电子邮件至 hugomatilla [at] gmail [dot] com,我会将其设为私密。贡献非常欢迎提出问题、评论和请求1. 目录1. 目录2. 创建和销毁对象1. 使用静态工厂方法代替构造函数2. 当面对许多构造函数时使用BUILDERS3. 使用私有构造函数或枚举类型强制执行单例属性4. 使用私有构造函数来强制实现不可实例化5. 避免创建对象6. 消除过时的对象引用7. 避免使用 finalizer3. 所有对象通用的方法8. 覆盖equals时遵守一般约定9.重写equals时务必重写hashCode10. 始终覆盖toString11.明智地覆盖克隆12.考虑实
资源推荐
资源详情
资源评论





























收起资源包目录




共 3 条
- 1
资源评论


赵闪闪168
- 粉丝: 1746
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- 计算机网络中的安全现状及对策.doc
- 华师上半电子商务概论平时作业.doc
- 计算机操作系统简介.docx
- 人事工资管理系统数据库设计.doc
- 计算机网络通信运用数据加密技术浅析.docx
- 基于开源技术的电子商务系统安全优化.docx
- PHP个人博客系统毕业设计方案.doc
- 单片机液位控制系统设计方案.doc
- 结合互联网+技术-实施整本书阅读活动.docx
- 探讨互联网+背景下的平面设计教学改革.docx
- 学生学籍管理系统(数据库系统)(SQL)52275.doc
- ATC汽车防护系统集成设计方案与应用.doc
- 单片机的无线温湿采集系统设计.doc
- PLC控制全自动洗衣机方案设计书.doc
- 基于微软Azure构建混合云概览.pptx
- 高校教师信息化优秀教学能力发展刍议.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制
