![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
CalvinGJH
这个作者很懒,什么都没留下…
展开
-
向上转型 向下转型
Java向下转型的意义_yinhuanxu-CSDN博客_向下转型 个人总结 前提存在两个类父类A子类B 向上转型 A a = new B(); 此时子类实例对象已经失去了子类中独有的方法 这种情况多数出现在泛型集合中,如list<A>,在向集合中新增元素时就存在向上转型的情况 向下转型 B b = (B)a 此时重新获得了因为向上转型而丢失的方法 ...原创 2021-10-21 15:17:46 · 62 阅读 · 0 评论 -
getSourse() 与getActionCommand 区别
getSource() Returns: The object on which the Event initially occurred. 依赖于事件对象 getActionCommand() Returns the command name of the action event fired by this button. If the command name is null (defa转载 2017-03-22 13:37:40 · 1023 阅读 · 0 评论