File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Method Invocation Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Method Invocation Problem" Watch "Method Invocation Problem" New topic
Author

Method Invocation Problem

Serkan Demir
Ranch Hand

Joined: Feb 03, 2005
Posts: 61
Hello,
I have a question on method invocation. Assume that i have a method, named "Factory(int code)".And it executes a pre-defined method according to its parameter. Do you know there is a way for such a method invocation,or in other words,transition from String to method invocation?


public void Factory(int code){
String methodName="getDescription_"+code+"()";
/* How can i invoke "methodName" method at this line?? */

}


A guy from Turkey<br /><a href="http://blogspot.serkandemir.com" target="_blank" rel="nofollow">http://blogspot.serkandemir.com</a>
D Rog
Ranch Hand

Joined: Feb 07, 2004
Posts: 472

Nothing simple:


Retire your iPod and start with HD Android music player Kamerton | Minimal J2EE container is here | Light weight full J2EE stack | and build tool | Co-author of "Windows programming in Turbo Pascal"
Serkan Demir
Ranch Hand

Joined: Feb 03, 2005
Posts: 61
thanks lot.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Method Invocation Problem