tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Serges N. Zubkoff" <>
Subject Re: instance names problem will pay $2 for solution
Date Wed, 02 Apr 2003 10:32:44 GMT
Hello Michael,

Wednesday, April 2, 2003, 2:24:21 PM, you wrote:

MN> i will pay $2 usd if you can solve my problem.  i'll send check by mail or 
MN> paypal.

MN> my problem is i have a String variable s which stores the name of the 
MN> instance i want to create.  how do i convert that variable to java code so 
MN> that i can use it in my java code.

MN> for instance

MN> this is what i want to do

MN> blue.use();
MN> red.use();

MN> but have somethign like
MN> s = "blue";
MN> something(s).use();
MN> s = "red";
MN> something(s).use();

MN> which does the samething as above

MN> mike

MN> _________________________________________________________________
MN> Protect your PC - get VirusScan Online  

MN> ---------------------------------------------------------------------
MN> To unsubscribe, e-mail:
MN> For additional commands, e-mail:

Constructor constructor =
Class.forName(yurStringValue).getConstructor(new Class[]
                       {/*base class constructor parameters types*/});
yuorInstance = (YourInctanceBaseClass)constructor.
              newInstance(new Object[]{/*constructor parameters*/});

Best regards,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message