Hi,
the Class objects you're talking about are somewhat special. They are dynamically created by the class loader in the JVM of an application at runtime the first time a class is used (take care of upper case names: Class is the class named "Class").
The ".class" language construct is neither a static member of Object nor of Test. It's a
Java language feature called
class literal!
There's one Class object created per class and all Class objects belong to class Class (sounds funny
).
Your example Test.class is the same as Class<Test> using generics. Other usual ways for retrieving a Class object is to use the Class.forName() method so that the JVM actually has to load a class. Or if you have already an object of your class type you can use the getClass() method inherited from Object.
I hope now it's a bit clearer... Oh, perhaps you want to take a look at the
API doc of class Class.
Marco
[ March 27, 2008: Message edited by: Marco Ehrentreich ]