3 回答
TA贡献1821条经验 获得超4个赞
Ibox myBox=new Rectangle();
Ibox myBox=new OtherKindOfBox();
myBox.close()
TA贡献1878条经验 获得超4个赞
java.util.Collections
sort()
reverse()
List
List
ArrayList
LinkedList
java.util.Collections
JTable
TA贡献1788条经验 获得超4个赞
class Animal{void walk() { } ........ //other methods and finallyvoid chew() { } //concentrate on this}
class Reptile extends Animal { //reptile specific code here} //not a problem here
class Bird extends Animal{...... //other Bird specific code} //now Birds cannot chew so this would a problem in the sense Bird classes can also call chew() method which is unwanted
class Animal{void walk() { } ........ //other methods }
interface Chewable {void chew();}
class Reptile extends Animal implements Chewable { }
class Bird extends Animal { }
- 3 回答
- 0 关注
- 545 浏览
添加回答
举报