java.lang.NoSuchMethodException: com.tt.mybatis_tk.test.CRUDMentMainTest.t2() at java.lang.Class.getMethod(Class.java:1786)

Class c = CRUDMentMainTest.class;
Method t2 = c.getMethod("t2");


因为c.getMethod("t2");只能调用 public 方法

改用:Method t2 = c.getDeclaredMethod("t2");
原文地址:https://www.cnblogs.com/blog-tian/p/15055135.html