I am trying to determine if two objects have the same class, and if so, to compare the objects for equality. I don’t know a way to do this, I am trying the following:
(((datum.getClass()).getName()).equals((Y.datum.getClass()).getName()))
? (datum.getClass()).equals(Y.datum):false;
I don’t know if this will work. Is there a better way?
The steps I am trying to duplicate are:
[1] Determine if the two objects are of the same class. I think that the conditional is one way of doing this. Is there a better way?
[2] If the objects are the same class, use equals to do the compare. Have I done this correct, and is there a better way to do it.
Any ideas would be helpful, and thanks.
1