I am looking to make my code more abstract so I dont need to repeat the same code. I am storing objects two different classes in the same arraylist. When searching, I need to check ahead of time to see if the entry in question is of a certain class before I compare any other values.
I've looked around online and all the comparison methods seem to be comparing the values inside the objects instead of comparing the class of each object.
Any predefined methods out there?