The following is a quote from Sun tutorial on reflection API.
If you know the name of the class at compile time, you can retrieve its Class object by appending .class to its name. In the next example, the Class object that represents the Button class is retrieved:
What's the mechanism behind appending the word class with the name of the class? How does that work? Thanks.
That's called a class literal - it's part of the language specification, right here. Basically that means that any Java compiler is required to recognize that if I type "Frame.class" for example, it should substitute a reference for the Class object representing a Frame. Much the way if I type a string literal enclosed in quotes, the compiler will interpret that as a reference to a String object.