Mmmm... it's true this is documented at java.sun.com, but this particular info is pretty hard to find unless you know about it already. It's not in the API anywhere (as far as I know), but rather the JLS. You're looking at what's called a class literal, and it's described here. Basically, "System.class" represents a Class object corresponding to the class "System". Despite its appearance, ".class" is not a member field of System, Object, or any other class - it's a special notation to refer directly to Class objects. Note that you can even have things like "int.class", which refers to the Class object representing the primitive type int. So it's worth remembering that the class Class really can represent any type, not just classes, and they really should've named the class "Type" (or even "DataType") rather than "Class" to minimize confustion. Too late now though... [ December 31, 2002: Message edited by: Jim Yingst ]
"I'm not back." - Bill Harding, Twister
Joined: Oct 30, 2002
Thank you and thanks to Sun for publishing the JLS on the web. I was hoping this was a deprecated relic of the 1.0 edition, but I see it's not. I paid Ellis & Stroustrup a fortune for the C++ reference manual. I was thinking of buying the JLS till I saw the Jini chick reference it. All I had seen was the first version at the book store.