花费 5 ms
Java向上转型的意义

问题:fun3()和fungod()分别是Student类和Allen类里面的方法,我想调用他们的时候为什么要向上转型呢,感觉没什么意义,直接写Student s=new Student ...

Wed Mar 15 01:02:00 CST 2017 0 4877

 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM