• Post Reply Bookmark Topic Watch Topic
  • New Topic

calling a metohd name usingn string  RSS feed

 
sammeta Phanikumar
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

I want to call a java method dynamically. That method name comes from the data base. So I would know method name at run time,will get that into a string variable. with that string variable want to call the method.

ex: java method: public void callDisplay(){}

I get from db: Display..I store it in String method="callDisplay()";

using method string variable want to call the method.


Please help me.
 
Vinod K Singh
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use reflection API to get the method and invoke it.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!