Click here to Skip to main content
15,891,423 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi all,

I have few doubts. Please correct me if I am wrong.

(1) " I've read so many forums and they say Class.forname("X") will load the class X into memory or register your class. In javadocs, they say a call to forName("X") causes the class named X to be initialized. " in this context, initialization of class is same as loading the class into memory ?

(2) invoking the class means creating the instance (object) of the class.
Posted

1 solution

This call returns the runtime Class object; this is not the same as an instance of the class. This allows you to get information about a particular class through reflection, which in turn allows you to access fields or methods of a class dynamically.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900