KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Possible Duplicate: Does Java guarantee that Object.getClass() == Object.getClass()? I know you're supposed to use equals() in general, but is there any way two Class<?> objects could be equal with equals() but not equal with == ? edit: I am specifically looking to find out whether two class objects exist such that Class<?> cl1 = ... Class<?> cl2 = ... cl1.equals(cl2) -> true cl1 == cl2 -> false This does not seemed to be covered by the possible duplicate question. (which is closely related) Also it may not be true that the class objects were obtained by someObject.getClass() -- it could be that one was the result of Class.forName(...) and the other from some series of reflective actions like Method.getReturnType() .
Tags (comma-separated)
Save Edits
Cancel