实例:通过Eclipse编写代码得到
package com.test.demo02;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
App app=new App();
System.out.println( app.getClass());//class com.test.demo02.App
System.out.println( app.getClass().getName() );//
}
}
输出:
System.out.println( app.getClass()); //class com.test.demo02.App
System.out.println( app.getClass().getName() ); //com.test.demo02.App