File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes how to instantiate a class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "how to instantiate a class" Watch "how to instantiate a class" New topic

how to instantiate a class

priya kalyan

Joined: Dec 19, 2000
Posts: 5
is it possible to create an instance of a class, whose name is
stored in a string variable.
ie String s="trial";
//(it a class file stored in the working directory)
how can u create an instance of this trial class when the name is
stored in a String variable.
help me with an example if u can..
thank u,
deekasha gunwant
Ranch Hand

Joined: May 06, 2000
Posts: 396
Hi Priya,
here is the code

run it and get back if any doubt
I agree. Here's the link:
subject: how to instantiate a class
It's not a secret anymore!