Re:Everything about Java 8
by rictic on Wednesday March 27, 2013 @01:45PM
(#5450871)
The point of getters and setters is to avoid exposing internal state to the outside. In this way you're not getting direct modification of fields, you're sending a signal: "hey Date object, get me your representation as an integer number of seconds since epoch", the outside doesn't care whether the Date internally uses the seconds since epoch representation, or whether it translates to this representation just for this method.
[ Parent
| on HN ]
There are no comments on this comment yet.