Importieren Sie Java.lang.*;
Code: Select all
/**
* @author Joey
*/
public class NewCompTets {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
NewCompTets cls = new NewCompTets();
NewCompTets 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 NewCompTets {
public static void test(){
System.out.print("2");
}
}