Effective Java Book important points
Articles in this series
This is the collection which I am writing based on the book Effective Java by Joshua Bloch . The book contains a lot of recommended practices (90 to be precise) collected in bundles based on chapters/concepts. These are a lot to read and remember at...
Part of a Series
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
Object is a concrete class, designed primarily for extension. This article would tell you when and how to override the methods.
Item 10: Obey the general contract when overriding equals
Item 11: Always override hashCode when you override e...
Item 15: Minimize the accessibility of classes and members
Item 16: In public classes, use accessor methods, not public fields
Item 17: Minimize mutability
Item 18: Favour composition over inheritance
Item 19: Design and document for inher...
Generics has been present since Java 5. They help in maintaining static typing by inserting casts and give error at compile time if inconsistent. They however comes at a price and the chapter aims to assist in using them efficiently.
Two special purpose families of reference types: Enums and Annotations.
Item 34: Use enums instead of int constants
Item 35: Use instance fields instead of ordinals
Item 36: Use EnumSet instead of bit fields
Item 37: Use EnumMap instead o...