There is need to compare two objects based on class they implement? When to compare using getClass() and when getClass().getName()? Is there any differ
getClass()
getClass().getName()
if you have an array to compare then use below
array.getClass().getComponentType() == X.class