题目内容
(1-3)请根据提示补全程序空白处,使程序能够正确运行。classAny{voidshow(){}}classAnimal{privateStringname;privatedoubleweight;publicAnimal(Stringname,doubleweight){this.name=name;this.weight=weight;}}//Cat是Animal的子类classCat①Animal{privateStringcolor;publicCat(Stringname,doubleweight,Stringcolor){②;//调用父类构造方法this.color=color;}public③voiddisplay(Tt,intcount){//泛型方法if(t④Any){Anyany=(Any)t;any.show();}System.out.println(count);}}
查看答案
搜索结果不匹配?点我反馈