• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need difference between invoking a method using java.lang.reflect.proxy and java.lang.reflect.Method  RSS feed

 
karthikeyan sai
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
could any one tell me the difference between invoking a method using reflection java.lang.reflect.Method and java.lang.reflect.Proxy

using both the class, we can invoke a method at runtime

1)
Method mthd=cl.getMethod("methodName",parameterName);
Integer output=(Integer)mthd.invoke(new RunMthdRef(),input);

2)

Proxy.newProxyInstance(super.getClass().getClassLoader(), new Class[] { adapter }, new SomeClass(this));

Does anybody have an idea?
 
Paul Clapham
Sheriff
Posts: 22841
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Karthik, you also posted the same question on another site. Please read this: BeForthrightWhenCrossPostingToOtherSites before you do that, and keep it in mind.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!