![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
javax学习之路
要懂得走位
想好好学习
展开
-
2021-09-07
引用多态:向上转型1. 什么是多态?同一操作作用于不同的对象,可以有不同的解释,产生不同的执行结果。2. 什么是向上转型?父类的引用指向其一个子类的对象,即为向上转型。①当子类没有定义与父类相同的属性,也没有重写父类的方法时,调用的都是父类的。父类:package day1;public class Father { public String name = "father"; public void show(){ System.out.println转载 2021-09-07 18:42:32 · 66 阅读 · 0 评论 -
2021-05-18
eclipse报错:No enclosing instance of type UserTest is accessible. Must qualify the allocation with an enclosing instance of type UserTest (e.g. x.new A() where x is an instance of UserTest).我写的内部类是动态的,也就是开头以public class开头。而主程序是public static class main。在Jav原创 2021-05-18 21:52:03 · 64 阅读 · 0 评论