Java Class getClasses() MethodThe getClasses() method of java Class class returns an array containing the Class objects which represents all the public classes and interfaces that are members of the class represented by the Class object. SyntaxParameterNA ReturnsReturns an array of class object. ThrowsSecurityException Example 1Test it NowOutput: Class 0 = ClassgetClassesExample1$subclass2 Class 1 = ClassgetClassesExample1$subclass1 Example 2Test it NowOutput: class ClassgetClassesExample2$MainSuperClass class ClassgetClassesExample2$StaticClass interface ClassgetClassesExample2$Interface1 class ClassgetClassesExample2$Class2 class ClassgetClassesExample2$Class1 Next TopicJava Class |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India