这几句是关键吧,定义cat类,然后fish类再继承cat类//类的定义改了
Type.registerClass("cat");//以下是fish类 继承cat
fish = function(name){
Type.initializeBase(this,[name]);
}
//重写父类方法eat
fish.prototype={
eat: function(){alert("fish Eating!");}
}
//继承cat
Type.registerClass("fish",cat);
Type.registerClass("cat");//以下是fish类 继承cat
fish = function(name){
Type.initializeBase(this,[name]);
}
//重写父类方法eat
fish.prototype={
eat: function(){alert("fish Eating!");}
}
//继承cat
Type.registerClass("fish",cat);
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货