这只是用来获得基本类的 Class 对象, Class byteClass = byte.class, 因为直接用 byte.getClass() 会产生编译错误,因为byte是基础类型。
The .class Syntax
If the type is available but there is no instance then it is possible to obtain a Class by appending ".class" to the name of the type. This is also the easiest way to obtain the Class for a primitive type.
boolean b;
Class c = b.getClass(); // compile-time error
Class c = boolean.class; // correct
Note that the statement boolean.getClass() would produce a compile-time error because a boolean is a primitive type and cannot be dereferenced. The .class syntax returns the Class corresponding to the type boolean.
Class c = java.io.PrintStream.class;
The variable c will be the Class corresponding to the type java.io.PrintStream.
Class c = int[][][].class;
The .class syntax may be used to retrieve a Class corresponding to a multi-dimensional array of a given type.