3 回答

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

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