aspose file tools
The moose likes Java in General and the fly likes instantiating the class whose name is stored in a string Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "instantiating the class whose name is stored in a string" Watch "instantiating the class whose name is stored in a string" New topic
Author

instantiating the class whose name is stored in a string

Harathi Rao
Ranch Hand

Joined: Oct 31, 2004
Posts: 42
Hi,
I have a small requirement. I have a string variable holding the name of the class. I want to get the object of that class using that string variable.

For ex. String str = "Test";
I want get the object of class 'Test' using string variable str.

Please guide me how to do it

Thanks
Harathi
Scheepers de Bruin
Ranch Hand

Joined: Jul 19, 2005
Posts: 99


We're doomed!!<br />Yay!!!<br />No that's bad Girr!!<br />Yay!!!
Harathi Rao
Ranch Hand

Joined: Oct 31, 2004
Posts: 42
Thanks alot.. It solved my problem.

Harathi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: instantiating the class whose name is stored in a string
 
Similar Threads
can the following code produces Null pointer exception?‏
Runtime Function calling -- code
Primitive Types!!!
StackOverFlow Exception help
object name to string variable