3 回答

TA貢獻(xiàn)1789條經(jīng)驗(yàn) 獲得超8個(gè)贊
Ibox myBox=new Rectangle();
Ibox myBox=new OtherKindOfBox();
myBox.close()

TA貢獻(xiàn)1824條經(jīng)驗(yàn) 獲得超5個(gè)贊
java.util.Collections
sort()
reverse()
List
List
ArrayList
LinkedList
java.util.Collections
JTable

TA貢獻(xiàn)1875條經(jīng)驗(yàn) 獲得超3個(gè)贊
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 { }
添加回答
舉報(bào)