您的位置:首页 > 其它

g++: -l[some]: linker input file unused because linking not done

2012-07-19 10:31 381 查看
public interface IHelloWorld {

void sayHello();

}


public class HelloWorldImpl implements IHelloWorld {

public void sayHello() {
System.out.println("Hello World!!");
}

}


public class HelloWorldHandler implements InvocationHandler {

IHelloWorld object;

public HelloWorldHandler(IHelloWorld object) {
this.object = object;
}

public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable {
System.out.println("before");
Object o = method.invoke(object, args);
System.out.println("after");
return o;
}

}


public class proxyDemo {

public static void main(String[] args) {
InvocationHandler handler = new HelloWorldHandler(new HelloWorldImpl());
IHelloWorld proxy = (IHelloWorld)Proxy.newProxyInstance(
HelloWorldImpl.class.getClassLoader(),
HelloWorldImpl.class.getInterfaces(),
handler);
proxy.sayHello();
}

}


before

Hello World!!

after
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐