Facebook Page Twitter Page LinkedIn Page
× Java.lang Package Classes

The java.lang.Class.getGenericInterfaces() method is used to return the Types representing the interfaces directly implemented by the class or interface represented by this object.


public Type[] getGenericInterfaces()


No parameter is required.

Return Value

Returns an array of interfaces implemented by this class.


  • throws GenericSignatureFormatError, if the generic class signature does not conform to the format specified in The Java Virtual Machine Specification.
  • throws TypeNotPresentException, if any of the generic superinterfaces refers to a non-existent type declaration.
  • throws MalformedParameterizedTypeException, if any of the generic superinterfaces refer to a parameterized type that cannot be instantiated for any reason.


The below example shows usage of the java.lang.Class.getGenericInterfaces() method.

import java.lang.*;
import java.lang.reflect.*;

public class MyClass {
  public static void main(String[] args) {
    try {
      Class cls = Class.forName("java.lang.Boolean");

      //print accessible public methods
      Type t[] = cls.getGenericInterfaces();
      System.out.println("Interfaces are: ");
      for(Type i: t)
    } catch (Exception e) {

The output of the above code will be:

Interfaces are: 
interface java.io.Serializable

❮ Java.lang - Class