Java基础练习中,子类如何通过继承实现长尾词功能?
- 内容介绍
- 文章标签
- 相关推荐
本文共计441个文字,预计阅读时间需要2分钟。
java// 父类:鸟class Bird { protected String name; protected String feather; protected String leg;
public Bird(String name, String feather, String leg) { this.name=name; this.feather=feather; this.leg=leg; }
public void speak() { System.out.println(name + says: 翅膀拍拍,两腿站立。
本文共计441个文字,预计阅读时间需要2分钟。
java// 父类:鸟class Bird { protected String name; protected String feather; protected String leg;
public Bird(String name, String feather, String leg) { this.name=name; this.feather=feather; this.leg=leg; }
public void speak() { System.out.println(name + says: 翅膀拍拍,两腿站立。

