| |
GeekInterview.com > Interview Questions > J2EE > Java Patterns
| Print | |
Question: What is Dynamic class in Java.
|
| May 05, 2007 05:56:28 |
#1 |
| vibha_kant |
Member Since: May 2007 Total Comments: 5 |
RE: What is Dynamic class in Java. |
Dynamic class in java is a class laoded at runtime by just knowing its name as a string. You need to call Class.forName() with complete name of the class as input. For ex.
Class c = Class.forName( "com.mypackage.Myclass" );
and can the create object by
MyObject obj = (MyObject) c.newInstance();
|
| |
Back To Question | |