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.也就是得出类或者实体所继承的父类名
如public class getClass { public static void main(String[] args) {
Object b=new Object();
System.out.println(b.getClass());
ObjectTest c=new ObjectTest();
System.out.println(c.getClass());
}
}
输出
class java.lang.Object
class j2.ObjectTest其中ObjectTest是我自己建的一个类
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.也就是得出类或者实体所继承的父类名
如public class getClass { public static void main(String[] args) {
Object b=new Object();
System.out.println(b.getClass());
ObjectTest c=new ObjectTest();
System.out.println(c.getClass());
}
}
输出
class java.lang.Object
class j2.ObjectTest其中ObjectTest是我自己建的一个类
我总感觉不太明白。
----------
可以读取一些配置文件和图片之类的东西
既然已经读了,顺便它也读了一下其它的文件。
这个方法和类信息有什么关系?