Monday, May 2, 2016

Effective Java

item 16: 
wrapper class


item 17:
The best solution to this problem is to prohibit subclassing in  classes that are not designed and documented to be safely subclassed. Two ways to do this:

  1. Declare the class final
  2. Make all the constructors private or package-private and to add public static factories in the place of the constructors.