方法反射实例 Posted on 2019-12-19 | In Java代码片段 方法反射实例1234567891011121314public class ReflectCase { public static void main(String[] args) throws Exception { Proxy target = new Proxy(); Method method = Proxy.class.getDeclaredMethod("run"); method.invoke(target); } static class Proxy { public void run() { System.out.println("run"); } }} Donate WeChat Pay