Retrieving other information through the class pointer : SuperClass « Reflection « Java






Retrieving other information through the class pointer

  

public class Main {
  public static void main(String[] argv) throws Exception {
    Class cc = null;
    cc = Main.class;
    System.out.println("The name of the superclass is " + cc.getSuperclass());
    System.out.println("Is SalariedEmployee an interface? " + cc.isInterface());
  }
}

   
    
  








Related examples in the same category

1.Getting the Superclass of an Object
2.Superclass of Object is null
3.The superclass of primitive types is always null
4.Although the type of o2 is an interface, getSuperclass() returns the object's superclass
5.Return true if class a is either equivalent to class b, or if class a is a subclass of class b, i.e. if a either "extends" or "implements" b.
6.Allows the user to reflectively inspect an object hierarchy