Online Java Compiler By
JavaTpoint.com
//import statements import java.lang.*; import java.util.*; public class ClassgetInterfacesExample1 { public static void main(String[] args) { showMethod(Thread.class); } public static void showMethod(Class class1) { System.out.println("Class :: " + class1.getName()); Class[] cll = class1.getClasses(); System.out.println("Classes :: " + Arrays.asList(cll)); Class[] intr = class1.getInterfaces(); System.out.println("Interfaces :: " + Arrays.asList(intr)); } }
Output