Loading classes at runtime
I am trying to write a Java program that accepts command line arguments which
specify classes to be loaded. Can I use the functions from the Class class
to do this? The program will not know the names of the classes until it
is run, however, it will know that all of the classes that it might encounter
extend a given class. For instance, on the command line the user will type:
java MyProgram A B (where A and B are classes that both extend class Letter).
Then, MyProgram's main function will create an instance of A and an instance
Any help you can give would be greatly appreciated.
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL