Effective Java Index
Hi guys, I am happy to tell you that I am moving to the open source world. And Java is the 1st language I have chosen for this migration. It's a nice chance to read some great books like "Effective Java 2nd Edition" and share the note for what I learned from it with you just as what I did before with CSharp. Here is the index of the notes. Hope you like it :)
Part I Creating and Destroying Object
Effective Java 01 Consider static factory methods instead of constructors
Effective Java 02 Consider a builder when faced with many constructor parameters
Effective Java 03 Enforce the singleton property with a private constructor or an enum type
Effective Java 04 Enforce noninstantiability with a private constructor
Effective Java 05 Avoid creating unnecessary objects
Effective Java 06 Eliminate obsolete object references
Effective Java 07 Avoid finallizers
Part II Methods common to all Objects
Effective Java 08 Obey the general contract when overriding equals
Effective Java 09 Always override hashCode when you override equals
Effective Java 10 Always override toString() method
Effective Java 11 Override clone judiciously
Effective Java 12 Consider implementing Comparable
Part III Classes and Interfaces
Effective Java 13 Minimize the accessibility of classes and members
Effective Java 14 In public classes, use accessor methods, not public fields
Effective Java 15 Minimize mutability
Effective Java 16 Favor composition over inheritance
Effective Java 17 Design and document for inheritance or else prohibit it
Effective Java 18 Prefer interfaces to abstract classes
Effective Java 19 Use interfaces only to define types
Effective Java 20 Prefer class hierarchies to tagged classes
Effective Java 21 Use function objects to represent strategies
Effetive Java 22 Favor static member classes over nonstatic
Part IV Generics
Effective Java 23 Don't use raw types in new code
Effective Java 24 Eliminate unchecked warnings
Effective Java 25 Prefer lists to arrays
Effective Java 26 Favor generic types
Effective Java 27 Favor generic methods
Effective Java 28 Use bounded wildcards to increase API flexibility
Effective Java 29 Consider typesafe heterogeneous containers
Part V Enums and Annotations
Effective Java 30 Use Enums instead of int constants
Effective Java 31 Use instance fields instead of ordinals
Effective Java 32 Use EnumSet instead of bit fields
Effective Java 33 Use EnumMap instead of ordinal indexing
Effective Java 34 Emulate extensible enums with interfaces
Effective Java 35 Prefer annotations to naming patterns
Effective Java 36 Consistently use the Override annotation
Effective Java 37 Use marker interfaces to define types
Part VI Methods
Effective Java 38 Check parameters for validity
Effective Java 39 Make defensive copies when needed
Effective Java 40 Design method signatures carefully
Effective Java 41 Use overloading judiciously
ffective Java 42 Use varargs judiciously
Effective Java 43 Return empty arrays or collections, not nulls
Effective Java 44 Write doc comments for all exposed API elements
Effective Java 45 Minimize the scope of local variables
Part VII General Programming
Effective Java 46 Prefer for-each loops to traditional for loops
Effective Java 47 Know and use the libraries
Effective Java 48 Avoid float and double if exact answers are required
Effective Java 49 Prefer primitive types to boxed primitives
Effective Java 50 Avoid strings where other types are more appropriate
Effective Java 51 Beware the performance of string concatenation
Effective Java 52 Refer to objects by their interfaces
Effective Java 53 Prefer interfaces to reflection
Effective Java 54 Use native methods judiciously
Effective Java 55 Optimize judiciously
Effective Java 56 Adhere to generally accepted naming conventions
Part VIII Exceptions
Effective Java 57 Use exceptions only for exceptional conditions
Effective Java 58 Use checked exceptions for recoverable conditions and runtime exceptions for programming errors
Effective Java 59 Avoid unnecessary use of checked exceptions
Effective Java 60 Favor the use of standard exceptions
Effective Java 61 Throw exceptions appropriate to the abstraction
Effective Java 62 Document all exceptions thrown by each method
Effective Java 63 Include failure-capture information in detail message
Effective Java 64 Strive for failure atomicity
Effective Java 65 Don't ignore exceptions
Part IX Concurrency
Effective Java 66 Synchronize access to shared mutable data
Effective Java 67 Avoid excessive synchronization
Effective Java 68 Prefer executors and tasks to threads
Effective Java 69 Prefer concurrency utilities to wait and notify
Effective Java 70 Document thread safety
Effective Java 71 Use lazy initialization judiciously
Effective Java 72 Don't depend on the thread scheduler
Effective Java 73 Avoid thread groups
Part X Serialization
Effective Java 74 Implement Serializable judiciously
Effective Java 75 Consider using a custom serialized form
Effective Java 76 Write readObject methods defensively
Effective Java 77 For instance control, prefer enum types to readResolve
Effective Java 78 Confider serialization proxies instead of serialized instances
// Kaibo
Effective Java Index的更多相关文章
- Effective java笔记(二),所有对象的通用方法
Object类的所有非final方法(equals.hashCode.toString.clone.finalize)都要遵守通用约定(general contract),否则其它依赖于这些约定的类( ...
- Effective Java通俗理解(下)
Effective Java通俗理解(上) 第31条:用实例域代替序数 枚举类型有一个ordinal方法,它范围该常量的序数从0开始,不建议使用这个方法,因为这不能很好地对枚举进行维护,正确应该是利用 ...
- Effective Java 第三版——19. 如果使用继承则设计,并文档说明,否则不该使用
Tips <Effective Java, Third Edition>一书英文版已经出版,这本书的第二版想必很多人都读过,号称Java四大名著之一,不过第二版2009年出版,到现在已经将 ...
- Effective Java 第三版——37. 使用EnumMap替代序数索引
Tips <Effective Java, Third Edition>一书英文版已经出版,这本书的第二版想必很多人都读过,号称Java四大名著之一,不过第二版2009年出版,到现在已经将 ...
- Effective Java 第三版——47. 优先使用Collection而不是Stream来作为方法的返回类型
Tips <Effective Java, Third Edition>一书英文版已经出版,这本书的第二版想必很多人都读过,号称Java四大名著之一,不过第二版2009年出版,到现在已经将 ...
- Java异常(二) 《Effective Java》中关于异常处理的几条建议
概要 本章是从<Effective Java>摘录整理出来的关于异常处理的几条建议.内容包括:第1条: 只针对不正常的情况才使用异常第2条: 对于可恢复的条件使用被检查的异常,对于程序错误 ...
- 【Effective Java】阅读
Java写了很多年,很惭愧,直到最近才读了这本经典之作<Effective Java>,按自己的理解总结下,有些可能还不够深刻 一.Creating and Destroying Obje ...
- Effective Java —— 消除过期的对象引用
本文参考 本篇文章参考自<Effective Java>第三版第七条"Eliminate obsolete object references" Memory leak ...
- 《Effective java》-----读书笔记
2015年进步很小,看的书也不是很多,感觉自己都要废了,2016是沉淀的一年,在这一年中要不断学习.看书,努力提升自己!预计在2016年要看12本书,主要涉及java基础.Spring研究.java并 ...
随机推荐
- TSwitch 中文简繁显示支持(XE6 Android)
说明: XE6 的 TSwitch 做了很多改进,包含多语显示处理,但 XE6 似乎只认定一种中文语系「zh」,它无法处理「zh_TW」.「zh_CN」.「zh_HK」.「zh_SG」等语系,不过可以 ...
- 专业PHP 7 IDE - Eclipse PDT 4.0 终于出世
2016年6月22日,第一款开源免费的完整支持PHP 7版本的IDE - PDT 4终于发布.原本我是期望Netbeans 8.2的,但PDT 4.0 发布,就等不及了. PDT团队很高兴的宣布PDT ...
- PagerTabStrip及自定义的PagerTab
如图是效果图 开发中经常会用到上面是一个Tab下面是一个ViewPager(ViewPager再包含几个Fragment),当点击Tab或是滑动ViewPager,Tab及ViewPager ...
- Junit很少出现的一个问题 No tests found matching ...
java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=test2], {ExactMatcher:fDisp ...
- 2016 年青岛网络赛---Family View(AC自动机)
题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=5880 Problem Description Steam is a digital distribut ...
- [javaEE] 反射-通过反射了解集合泛型本质
java中的泛型是防止错误输入的,只在编译时刻起作用 package com.tsh.reflect; import java.lang.reflect.Method; import java.uti ...
- python 实时遍历日志文件
首先尝试使用 python open 遍历一个大日志文件, 使用 readlines() 还是 readline() ? 总体上 readlines() 不慢于python 一次次调用 readlin ...
- Webpack - CommonJs & AMD 模块打包器
Webpack 是一个 CommonJs & AMD 模块打包器.可以把你的 JavaScript 代码分离为多个包,在需要的时候进行加载,支持预处理文件,例如 json, jade, cof ...
- Slides - 在线制作效果精美的幻灯片(PPT)
Slides 是可以在浏览器中使用的在线幻灯片编辑器.与传统的演示软件,比如 PowerPoint 相比,Slides 不需要下载任何东西.你所有的信息都是安全地存储在我们的服务器上,无论你在哪里.不 ...
- 使用nodejs+express+socketio+mysql搭建聊天室
使用nodejs+express+socketio+mysql搭建聊天室 nodejs相关的资料已经很多了,我也是学习中吧,于是把socket的教程看了下,学着做了个聊天室,然后加入简单的操作mysq ...