Skip to content

learnitmyway/EffectiveJava

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Effective Java

My own examples from Effective Java by Joshua Bloch using TDD.

2 Creating and Destroying Objects

  • Item 1 - Consider static factory methods instead of constructors
  • Item 2 - Consider a builder when face 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

3 Methods Common to All Objects

  • Item 8 - Obey the general contract when overriding equals
  • Item 9 - Always override hashCode when you override equals
  • Item 10 - Always override toString
  • Item 11 - Override clone judiciously
  • Item 12 - Consider implementing Comparabale

4 Classes and Interfaces

  • Item 15 - Minimize Mutability
  • Item 18 - Prefer interfaces to abstract classes

7 Methods

  • Item 38 - Check parameters for validity
  • Item 41 - Use overloading judiciously
  • Item 43 - Return empty arrays or collections, not nulls

9 Exceptions

  • Item 58 - Use checked exceptions for recoverable conditions and runtime exceptions for programming errors
  • Item 59 - Avoid unnecessary use of checked exceptions
  • Item 60 - Favor the use of standard exceptions

About

My own examples from Effective Java by Joshua Bloch

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages