public class MethodName { public static void main(String[] args) { String name = new Object() { }.getClass().getEnclosingMethod().getName(); System.out.println(name); } }
No comments:
Post a Comment