摘要: 上次公司内部考试时考到了,但是没用过,考到了一大片。今天看书的时候又看到这个方法,于是稍微分析了一下。 public class Test { public static void Main(string[] args) { int bookIndex; string[] book1 = { "book1", "book7", "book3" }; bookIndex = Array.BinarySearch(book1,"book3"); Con... 阅读全文
posted @ 2012-11-23 16:37 のんきネコ 阅读(1925) 评论(1) 推荐(0) 编辑
摘要: 声明接口public interface Iinterface { void GetUserName(); } 同上以上示例可以看出,接口中只能包含方法、属性、索引器和事件的声明。不允许声明成员上的修饰符。 因为接口成员是暴露的,所以添加其他修饰符毫无意思,甚至连public都不用加。接口的派生public interface Iinterface{ string GetUserName();}class Test1 : Iinterface{ public string GetUserName() { return "name"; }} 如果一个派... 阅读全文
posted @ 2012-11-23 13:18 のんきネコ 阅读(181) 评论(0) 推荐(0) 编辑