一个接口比拥有正确的方法更重要吗?
public interface IBox{ public void setSize(int size); public int getSize(); public int getArea(); //...and so on}
public class Rectangle implements IBox{ private int size; //Methods here}
public static void main(String args[]){ Ibox myBox=new Ibox();}
public static void main(String args[]){ Rectangle myBox=new Rectangle();}
收到一只叮咚
UYOU
尚方宝剑之说