O'Reilly logo
  • Shayne Riley thinks this is interesting:

if a class is package-private or is a private nested class, there is nothing inherently wrong with exposing its data fields—assuming they do an adequate job of describing the abstraction provided by the class.


Cover of Effective Java™


This approach generates less visual clutter than the accessor-method approach