I'll leave it because it's interesting
test.pde
import java.lang.reflect.*;
void setup(){
Test test=new Test();
}
class Test{
Test(){
try{
this.getClass().getMethod("test").invoke(this);
}catch(NoSuchMethodException | e){
println(e);
}catch(IllegalAccessException e){
println(e);
}catch(InvocationTargetException e){
println(e);
}
}
void test(){
println("test");
}
}
Similarly in java
Recommended Posts