Online Java Compiler By
JavaTpoint.com
public class CompilerCompileClassesExample1 { public static void main(String[] args) { CompilerCompileClassExample1 c1 = new CompilerCompileClassExample1(); CompilerCompileClassExample1 c2 = new CompilerExamples(); //class CompilerCompileClassExample1 Class g1 = c1.getClass(); System.out.println(g1); //subclass CompilerExample Class g2 = c2.getClass(); System.out.println(g2); //Using compileclass method String str = "CompilerCompileClassesExample1"; boolean r = Compiler.compileClasses(str); System.out.println("Value returned by method is : "+r); } } class CompilerExamples extends CompilerCompileClassExample1{ //It is subclass of CompilerCompileClassExample1 }
Output