摘要: 1.Java静态代理举例: 代理类和被代理类在编译期间就已经确定下来了 1 interface ClothFactory{ 2 void produceCloth(); 3 } 4 5 class ProxyClothFactory implements ClothFactory{ 6 privat 阅读全文
posted @ 2022-07-11 15:26 jue1e0 阅读(113) 评论(0) 推荐(0)
摘要: 1.调用运行时类的属性 1 public static void testField() throws Exception { 2 Class clazz = Person.class; 3 //创建运行时类的对象 4 Person p = (Person) clazz.newInstance(); 阅读全文
posted @ 2022-07-11 12:58 jue1e0 阅读(65) 评论(0) 推荐(0)