posted 13 years ago
why isn't it returing null as ToDos class doesnot override equals or hashCode ?
K&B book Sorting Collections and Arrays page-583
Remember that when you use a class that implements Map, any classes that you
use as a part of the keys for that map must override the hashCode() and equals()
methods. (Well, you only have to override them if you're interested in retrieving
stuff from your Map. Seriously, it's legal to use a class that doesn't override equals()
and hashCode() as a key in a Map; your code will compile and run, you just won't
find your stuff.)
OCPJP 6.0 93%
OCPJWCD 5.0 98%