I am storing Classes (not objects) in a HashMap
...
But I don't understand if it will work correctly... because I can't override equals()
or hashCode()
, right? I mean, the HashMap
must compare the 2 Classes, not the 2 Objects...
So, will it work simply putting Classes into a HashMap
?
or will it cause problems?
protected HashMap<Class<? extends MyBaseClass>, int> someTable = new HashMap<>();