作业怎么做啊
作业你们是怎么写的
作业你们是怎么写的
2017-11-14
我是这么写的
Car car = new Car();
Class carClass = car.getClass();
InvocationHandler timeHandler = new TimeHandler(car);
Moveable proxy = (Moveable) Proxy.newProxyInstance(carClass.getClassLoader(),
carClass.getInterfaces(),timeHandler);
InvocationHandler logHandler = new LogHandler(proxy);
Moveable proxy2 = (Moveable) Proxy.newProxyInstance(proxy.getClass().getClassLoader(),
proxy.getClass().getInterfaces(), logHandler);
proxy2.move();
举报