因为理解不了Foo.class.getName()的结构?
请教~~~

解决方案 »

  1.   

    The following example uses a Class object to print the class name of an object: 
         void printClassName(Object obj) {
             System.out.println("The class of " + obj +
                                " is " + obj.getClass().getName());
         }
     It is also possible to get the Class object for a named type (or for void) using a class literal (JLS Section 15.8.2). For example: 
         System.out.println("The name of class Foo is: "+Foo.class.getName());可供参考~~