«
^
»
4.6. It is not a problem for immutable classes
Not a problem for an
immutable class
.
In such circumstances, you will be able to choose a
hashCode
function that helps to speed up searching.
So if we removed
setYear
,
setMonth
and
setDay
, we could then use either of the two
hashCode
given earlier.
This would speed up the searching for dates when they have been stored in a
Hashtable
, a
HashSet
or a
HashMap
.