I have an incoming object of an unknown class (null possible). I need to test if the object is of a specific class.
While this is functional, it seems bulky to fetch an item from map, and then it's class. Is there a better way to test against a known class without comparing to an existing actual instance of the class? (note this is not to compare the actual objects, but the class itself before acting on the incomingObject) ...maybe there is a better approach from the beginningif (incomingObject.getClass() == map[0][0].getClass()) { // go go go! } else if(incomingObject.getClass() == null) { // brakes, turn, go } else { // Ebrake!! }