-
Creating and Destroying Objects
- Aug 31, 2015 Item 01 - Consider static factory methods instead of constructors
- Aug 30, 2015 Item 02 - Consider a builder when faced with many constructor parameters
- Aug 29, 2015 Item 03 - Enforce the singleton property with a private constructor or an enum type
- Aug 28, 2015 Item 04 - Enforce noninstantiability with a private constructor
- Aug 27, 2015 Item 05 - Avoid creating unnecessary objects
- Aug 26, 2015 Item 06 - Eliminate obsolete object references
- Aug 25, 2015 Item 07 - Avoid finalizers
-
Methods Common to All Objects
- Aug 24, 2015 Item 08 - Obey the general contract when overriding equals
- Aug 23, 2015 Item 09 - Always override hashCode when you override equals
- Aug 22, 2015 Item 10 - Always override toString
- Aug 21, 2015 Item 11 - Override clone judiciously
- Aug 20, 2015 Item 12 - Consider implementing Comparable
-
Classes and Interfaces
- Aug 19, 2015 Item 13 - Minimize the accessibility of classes and members
- Aug 18, 2015 Item 14 - In public classes, use accessor methods, not public fields
- Aug 17, 2015 Item 15 - Minimize mutability
- Aug 16, 2015 Item 16 - Favor composition over inheritance
- Aug 15, 2015 Item 17 - Design and document for inheritance or else prohibit it
- Aug 14, 2015 Item 18 - Prefer interfaces to abstract classes
- Aug 13, 2015 Item 19 - Use interfaces only to define types
- Aug 12, 2015 Item 20 - Prefer class hierarchies to tagged classes
- Aug 11, 2015 Item 21 - Use function objects to represent strategies
- Aug 10, 2015 Item 22 - Favor static member classes over nonstatic
-
Generics
- Aug 9, 2015 Item 23 - Don’t use raw types in new code
- Aug 8, 2015 Item 24 - Eliminate unchecked warnings
- Aug 7, 2015 Item 25 - Prefer lists to arrays
- Aug 6, 2015 Item 26 - Favor generic types
- Aug 5, 2015 Item 27 - Favor generic methods
- Aug 4, 2015 Item 28 - Use bounded wild cards to increase API flexibility
- Aug 3, 2015 Item 29 - Consider typesafe heterogeneous containers
-
Enums and Annotations
- Aug 2, 2015 Item 30 - Use enums instead of int constants
- Aug 1, 2015 Item 31 - Use instance fields instead of ordinals
- Jul 31, 2015 Item 32 - Use EnumSet instead of bit fields
- Jul 30, 2015 Item 33 - Use Enum Map instead of ordinal indexing
- Jul 29, 2015 Item 34 - Emulate extensible enums with interfaces
- Jul 28, 2015 Item 35 - Prefer annotations to naming patterns
- Jul 27, 2015 Item 36 - Consistently use the Override annotation
- Jul 26, 2015 Item 37 - Use marker interfaces to define types
-
Methods
- Jul 25, 2015 Item 38 - Check parameters for validity
- Jul 24, 2015 Item 39 - Make defensive copies when needed
- Jul 23, 2015 Item 40 - Design method signatures carefully
- Jul 22, 2015 Item 41 - Use overloading judiciously
- Jul 21, 2015 Item 42 - Use varargs judiciously
- Jul 20, 2015 Item 43 - Return empty arrays or collections, not nulls
- Jul 19, 2015 Item 44 - Write doc comments for all exposed API elements
-
General Programming
- Jul 18, 2015 Item 45 - Minimize the scope of local variables
- Jul 17, 2015 Item 46 - Prefer for-each loops to traditional for loops
- Jul 16, 2015 Item 47 - Know and use the libraries
- Jul 15, 2015 Item 48 - Avoid float and double if exact answers are required
- Jul 14, 2015 Item 49 - Prefer primitive types to boxed primitives
- Jul 13, 2015 Item 50 - Avoid strings where other types are more appropriate
- Jul 12, 2015 Item 51 - Beware the performance of string concatenation
- Jul 11, 2015 Item 52 - Refer to objects by their interfaces
- Jul 10, 2015 Item 53 - Prefer interfaces to reflection
- Jul 9, 2015 Item 54 - Use native methods judiciously
- Jul 8, 2015 Item 55 - Optimize judiciously
- Jul 7, 2015 Item 56 - Adhere to generally accepted naming conventions
-
Exceptions
- Jul 6, 2015 Item 57 - Use exceptions only for exceptional conditions
- Jul 5, 2015 Item 58 - Use checked exceptions for recoverable conditions and runtime exceptions for programming errors
- Jul 4, 2015 Item 59 - Avoid unnecessary use of checked exceptions
- Jul 3, 2015 Item 60 - Favor the use of standard exceptions