java.lang.Compiler.compileClass()


java.lang.Compiler.compileClass()

package com.codingdict;



import java.lang.*;



public class CompilerDemo {



   public static void main(String[] args) {



      CompilerDemo cls = new CompilerDemo();

      CompilerDemo subcls = new SubClass1();



      // class CompilerDemo

      Class c = cls.getClass(); 

      System.out.println(c);



      // sub class SubClass1

      Class c1 = subcls.getClass();

      System.out.println(c1);



      /* returns false if the compilation failed or no compiler is 

         available */

      boolean retval = Compiler.compileClass(c1);



      System.out.println("Return Value = " + retval); 

   }

} 



class SubClass1 extends CompilerDemo {

   // sub class

}