public class Test11 {
/*
* 编译时看父类,运行时看子类
*/
public static void main(String[] args) {
Student student=new Student();
System.out.println((Object)student instanceof Student);
}
}
class Student{
private String name;
}
【面向对象】——编译时看父类,运行时看子类
最新推荐文章于 2022-11-04 10:41:15 发布