Why would a date class have read-only instance vars?
Because that way you can use a Date like a value type (that is, share one object in different contexts without the risk that some other context might change it).
Immutable objects also have the nice property of being sharable among threads without need for any locking.
In reply to Re^3: The fallacy of the *requirement* for read-only instance variables.
by moritz
in thread The fallacy of the *requirement* for read-only instance variables.
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |