3 回答

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

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

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