Why Java's Collection.contains() use 'Object o' as the parameter, unlike Collection.add() which uses the generic E?
This gives rise to potential mistakes like
HashSet<Integer> hash = new HashSet();
hash.contains(1.42); //will always be false
Why Java's Collection.contains() use 'Object o' as the parameter, unlike Collection.add() which uses the generic E?
This gives rise to potential mistakes like
HashSet<Integer> hash = new HashSet();
hash.contains(1.42); //will always be false