Online Java Compiler By
JavaTpoint.com
import java.io.Serializable; import java.util.Arrays; public class ClassgetClassesExample2 { public static void main(String... args) { Class>[] classarry = ClassgetClassesExample2.class.getClasses(); Arrays.stream(classarry).forEach(System.out::println); } public class Class1 extends Class2 implements Cloneable { } public class Class2 implements Serializable { } public interface Interface1 extends Serializable { } public static class StaticClass { } public static class MainSuperClass { } }
Output