3 回答

TA贡献2041条经验 获得超4个赞
Ibox myBox=new Rectangle();
Ibox myBox=new OtherKindOfBox();
myBox.close()

TA贡献1982条经验 获得超2个赞
java.util.Collections
sort()
reverse()
List
List
ArrayList
LinkedList
java.util.Collections
JTable

TA贡献1876条经验 获得超5个赞
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 { }
添加回答
举报