一个接口比拥有正确的方法更重要吗?
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();}
拉风的咖菲猫
拉丁的传说
沧海一幻觉
翻过高山走不出你
随时随地看视频慕课网APP
相关分类