See this simple example:
// ********************
public class MyClass{
public static void main(String[] s) {
MyClass m = new MyClass();
System.out.println(MyClass.class); // class MyClass
System.out.println(m.getClass()); // class MyClass
}
}
// ********************
I got almost the same question in our
SCJD study group, which motivated me enough to find out what is it.
I did a search in JDK source code. No class as a field anywhere, not in Class class, not in Object class, absolutely no where. It is the keyword class can be used this way, to return the Class instance object of MyClass.
Roseanne
[This message has been edited by Roseanne Zhang (edited December 05, 2000).]