Why does not include a generic equals()?
Why does the the Generics "Enhancement" of java not include a generic equals
method?
I am not strong on Generics; however something like:
public boolean equals(<?>)
It seems to me that a wild card based equals would be extremely handy.
It would be open enough to allow the standard use and overriding; while at the
same time allowing for cast-less checks for equivalence over large sets of data
objects. This would allow for faster sorting and data manipulation.
Am I missing something?
# 2
I understand that the standard Object.equals(Object obj) method which has
been there since Java 1.0.However, I am specifically concerned with being
able to "Genericize" the Equals method to specifically remove the down cast
required before being able to accessing any object specific elements. Casts
are expensive and it slows down large list (1k+ objects) considerably.
I could be confused about how Generics work, however, the constructor and
definition of java.lang.Object has been genericized so it makes sense to have
this option too.