首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

一道小弟我的考研题

2011-12-27 
一道我的考研题UsingtheexampleofPayrollSystemUsingPolymorphism tocreatetheexampleofAnimal,Dog,andC

一道我的考研题
Using   the   example   of   "Payroll   System   Using   Polymorphism "   to   create   the   example   of   Animal,   Dog,   and   Cat   by   using   Polymorphism,   and   to   use   one   loop   to   make   the   cat   and   dog   "Jiao "   one   time!

[解决办法]
多态嘛,animal是父类,有一个方法jiao(),cat dog继承animal,然后循环调用父类的jiao()
[解决办法]
java中没有多重继承,只有接口可以变相的实现,
public interfece Animal{}
public class dog extends Animal{}
public class cat extend Animal{}

热点排行