I have a class that extends to another class and that class extends to another class.
class 1 extends class 2 class 2 extends class 3 class 3 extends class
The other answers are right about using Class.getSuperclass(). But you have to do it repeatedly. Something like
Class superClass = getSuperclass(); while(superClass != null) { // do stuff here superClass = superClass.getSuperclass(); }