Article View: comp.lang.java.help
Article #77Dynamically load and instantiate unknown classes at runtime.
From: Brent Peckover
Date: Sat, 20 Mar 1999 00:00
Date: Sat, 20 Mar 1999 00:00
11 lines
1292 bytes
1292 bytes
I'm trying to create an application which will allow itself to be extended without requiring the original code. Information comes into a control thread, and is then synchronously passed to a list of classes which are not know at design time. How do I tell Java to Load a class (say I get the required class name out of a text file at runtime), create an instance of the class, and then call the new instance's methods (which may also be listed in the file)? Anyone have any suggestions?
Technical Details
Message-ID:
<36F3DDDE.2FF6DBD4@archiveware.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 113ae9,59c3d3f2dc30d0e6,start X-Google-Attributes: gid113ae9,public X-Google-Thread: f74b3,59c3d3f2dc30d0e6,start X-Google-Attributes: gidf74b3,public From: Brent Peckover <brentp@archiveware.net> Subject: Dynamically load and instantiate unknown classes at runtime. Date: 1999/03/20 Message-ID: <36F3DDDE.2FF6DBD4@archiveware.net> X-Deja-AN: 456953946 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@home.net X-Trace: news.rdc1.ab.wave.home.com 921951883 24.64.241.197 (Sat, 20 Mar 1999 09:44:43 PDT) Organization: ArchiveWare MIME-Version: 1.0 NNTP-Posting-Date: Sat, 20 Mar 1999 09:44:43 PDT Newsgroups: comp.lang.java.help,borland.public.jbuilder.java.language