Dynamic Class Loading : Java Glossary


Dynamic Class Loading
You can dynamically load a class and create objects of that class just by knowing its name as a String. Typically you would cast the objects created to some interface so that you could invoke methods on it.
Class c = Class.forName( "com.mindprod.mypackage.Myclass" );
Thing t = (Thing)c.newInstance( );

This page is posted
on the web at:


Optional Replicator mirror
of mindprod.com
on local hard disk J:

Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

Your face IP:[]
You are visitor number