标签:python bsp png src children getc 获取 实例 inf
取Class类对象的几种方法:
Test test = new Test();
在运行时确定,所以运行实例才是该类对象。super.getClass()不能获得父类的类对象,仍然是当前类对象。
获得父类类对象: test.getClass().getSuperclass()
class Father{ public void showName() { System.out.println("Father..."); } } class Child extends Father{ public void showName() { System.out.println("children"); } } Father father = new Child(); System.out.println(Father.class); 结果是 Father
标签:python bsp png src children getc 获取 实例 inf
原文地址:https://www.cnblogs.com/yoyo1216/p/12680060.html