解决方案 »

  1.   

    getClass是非覆盖式的从Object继承来的,Object的getClass()方法的释义是:
    返回此 Object 的运行时类。返回的 Class 对象是由所表示类的 static synchronized 方法锁定的对象。
    /**
         * Returns the runtime class of this {@code Object}. The returned
         * {@code Class} object is the object that is locked by {@code
         * static synchronized} methods of the represented class.
         **/
      释义指出,要返回此Object运行时类,这当然不可能指Object自己了,否则所有类调用getClass()方法都返回Object.class了。那到底谁是Object的运行时类呢,不是Object自己,当然就只能是他的儿子、或各种孙子了。这里就是Employee了(无论是用super.getClass()还是this.getClass())。如果想要从Employee中得到Object.class,可以用this.getClass().getSuperclass();
      

  2.   

    getClass()表示此对象运行时类的 Class 对象。
    所以楼主super.getClass().getName()和this.getClass().getName()都是返回到Employee