What to replace foo() with?
class MethodIteration {
public static void main(String[] args) {
for (MyFuncInt m : new MyFuncInt[] { Class1::method, Class2::method })
System.out.println(m.getClass().foo()); // want Class1, Class2 etc here
}
}
Sorry about brevity. Mobile device ;)
I don't think it's a duplicate of mentioned question since I want to get the name while outside the class containing the static method. If I try m.getClass().getName()
I get "MethodIteration$$Lambda$1:[someHash]".