public class Test { public static void main(String[] args) { Class c; c = Class.forName("K"); try{ Method m = c.getMethod("aa", new Class[] { String.class }); m.invoke(c, new Object[] { "test" }); }catch(Exception e) { e.printStackTrace(); } } }
时间: 2024-09-30 05:55:30