一个接口比拥有正确的方法更重要吗?
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();}
千万里不及你
慕桂英3389331
米脂
心有法竹
随时随地看视频慕课网APP
相关分类