Multiple classes in an (undefined) ArrayList?

@quark

Question One

Cool would be when a method could tell us it’s name

  println("I am "
    + this.getClass().getName());

but that’s only the name of the Sketch!

How can I get the name of the method I am in?


Question Two

And can i retrieve the full text of a method:

  for (java.lang.reflect.Method currentMethod : getClass().getDeclaredMethods()) {

    print("toString() gives : ");
    println(currentMethod.toString()); // works, gives only header


    println(currentMethod.getBody()); // ????????????????????
}
2 Likes