Get the superclass of interfaces (always null) in Java

Description

The following code shows how to get the superclass of interfaces (always null).

Example


/*from w  ww. j a v  a  2  s  .c o m*/
public class Main {
  public static void main(String[] argv) throws Exception {

    Class cls = java.lang.Cloneable.class;
    Class sup = cls.getSuperclass(); // null
    System.out.println(sup);
  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    Reflection »




Annotation
Array
Class
Constructor
Field
Generics
Interface
Method
Modifier
Package
Proxy