constructor problem !!!

Hi !

At some point inside a class, I have name of the constructor of another class and the arguments to be passed to it in the STRING format. I need this information to invoke this constructor of other class. How can I do that?

For example, I m in the constructor of the class named "Carrier". Inside this Carrier's constructor, I have a string named "Service" and another string named "Vai". Service is another class. I want to invoke the constructor of Service class [ which is Service(String str ) ] with the arguments as a string "Vai".

Can ne 1 help me with this matter?

Thanks!

-Vaibhav.

[639 byte] By [v_sanas] at [2007-9-26 21:12:30]
# 1
Hi,Perhaps you are looking for something like this --String className;Class c = Class.forName (className);return c.newInstance();
tgitnick at 2007-7-3 20:39:47 > top of Java-index,Other Topics,Java Community Process (JCP) Program...