摘要: 接口的概念:简单地说借口就是定义了一些方法的类,但这些方法并未实现。接口可以多重继承,一个类一旦引用了一个或多个接口,就必须实现,否则是报错。定义接口:namespace 接口{ interface Interface1 { int getmax(int a,int b); void reset(string n); }}//类class实现接口interface1class Class1 : Interface1 { int s; //实现接口的方法必须声明为public,因为有些方法在接口中是隐式共有的,所以实现也必须是共有的 public int getmax(int m, int n 阅读全文
posted @ 2013-01-22 16:04 逆光迷矢 阅读(223) 评论(0) 推荐(0) 编辑