At 01:11 �� 26/6/2000 +0300, you wrote:
>Hi,
>     I 'm working on a project and I have encountered a problem. "I have
>to call a method of a class."
>     It seems quite simple till here. However the name of the class and
>the method will be known at run-time.
>     They will be retrieved from a database as Strings. The communication
>beween the classes is handled by CORBA.
>     The Reflection and Introspection APIs aren't suitable here because I
>don't even know the name of the class at
>     deployment time in order to get a reflection of the constructors,
>methods and Fields. My actual question is
>     "Can I call a method whose name is stored in a String? If Yes HOW?"

I the "desired" class is reachable by your ClassLoader, and at least you
know  at run-time the exact class name, then the reflection API is
_suitable_ for your needs. You can get an instance of the class by issuing
a Class.forName(className).newInstance();. If you can get all the
"accessible" method & attributes of the class as well and invoke the
desired methods on the instance you've obtained before.

Anyway your post is "out of topic", since you are Greek you could
reconsider and subscribe to the java-greek-dev list. You can subscribe by
sending a empty message to [EMAIL PROTECTED]



>     Thanks in advance

Best Regards
Filippos Slavik


################################################################
Filippos Slavik
Forthnet R&D, Hrakleio, Greece
e-mail : [EMAIL PROTECTED]
phone : (+3) 081 391230
################################################################

"The software said 'runs on Win95 or better,' so I installed it
on Linux..."

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to