3 回答
TA貢獻1821條經(jīng)驗 獲得超5個贊
Ibox myBox=new Rectangle();
Ibox myBox=new OtherKindOfBox();
myBox.close()
TA貢獻1878條經(jīng)驗 獲得超4個贊
java.util.Collectionssort()reverse()ListListArrayListLinkedListjava.util.Collections
JTable
TA貢獻1788條經(jīng)驗 獲得超4個贊
class Animal{void walk() { } ........ //other methods and finallyvoid chew() { } //concentrate on this}class Reptile extends Animal { //reptile specific code here} //not a problem hereclass 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 unwantedclass Animal{void walk() { } ........ //other methods }interface Chewable {void chew();}class Reptile extends Animal implements Chewable { }class Bird extends Animal { }- 3 回答
- 0 關注
- 626 瀏覽
添加回答
舉報
