What is Dynamic class in Java.

Showing Answers 1 - 6 of 6 Answers

vibha_kant

  • May 14th, 2007
 

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();

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions