Is it possible to compose new class at runtime in Java?
What are the means for that? Refection? Compiler API?
I can do
package tests;
public class TryReflection02 {
interface A {
}
public static void main(String[] args) {
Object o = new A() {};
System.out.println( o.toString() );
o = A.class.newInstance() // exception
}
}
Can I do the same having A.class
value?