正在加载图片...
扩充( extends)父类别 pub1 ic class chickenextends bird{//扩充Bird类另 private string crest;//新增私有成员,鸡冠描迹 public Chicken()f super()i) //定义建构方法 public Chicken(String name, String crest)i super(name)i this crest cresti //新增方法 ublic void setCrest(string crest) t this crest crest public String getcrest()i return cresti public void wu()i System.out. print1n("咕咕叫.");扩充(extends)父类别 public class Chickenextends Bird { //扩充Bird类别 private String crest; //新增私有成员,鸡冠描述 public Chicken() {super(); } //定义建构方法 public Chicken(String name, String crest) { super(name); this.crest = crest; } //新增方法 public void setCrest(String crest) { this.crest = crest; } public String getCrest() { return crest; } public void wu() { System.out.println("咕咕叫…"); } }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有