public final Class getClass()
怎么用getClass()

解决方案 »

  1.   

    getClass
    public final Class getClass()
    Returns the runtime class of an object. That Class object is the object that is locked by static synchronized methods of the represented class. Returns:
    the object of type Class that represents the runtime class of the object.
    getClass不是静态方法,它是Object中定义的,返回代表一个对象的类别的Class对象
      

  2.   

    返回代表一个对象的类别的Class对象那这个类别也必须是存在的对象了?
      

  3.   

    直接用就行了
    得到你类运行的ClassPath的引用