I have a singleton object like:
Object o = new Object () {
public void test() {
//...
}
};
But I cannot use o.test() because the class/interface does not have that method. Is there any way to achieve this using meta programming such as getMethods? Please do not suggest declaring an interface.
Runnableinstead, since you're just running a void method, right?