This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Originally posted by faisal usmani: Hello ranchers ,
What is Class Object or meta-class , what is it's use , how do we define it ?
Thanx in advance
A Class object is used to represent a class. With it, you can get information about a class, instantiate an object of that class, invoke methods, etc.
If you have an instance, you can get the Class object via the getClass() method. If you know the name of a particular class -- say MyClass -- you can get the Class object via MyClass.class. And you can also directly load the class -- and get a Class object -- from the class loader via the forName() method.