Class.forName()

Ads

 
 

Share on Google+Share on Google+

Deepak Kumar
Class.forName()
1 Answer(s)      6 years and 11 months ago
Posted in : Java Beginners
Hi,

What is Class.forName() does and how it is useful? What does it do?

Thanks
Ads
View Answers

October 5, 2010 at 3:48 PM


It loads the class into the ClassLoader. It returns the Class. Using that you can get the instance ( "class-instance".newInstance() ).

Thanks

Ads