8.C#编程指南-索引器
摘要:
索引器允许类或结构的实例像数组一样进行索引。索引器类似于属性,不同之处在于它们的访问器采用参数。View Code class SampleCollection<T>{ // Declare an array to store the data elements. private T[] arr = new T[100]; // Define the indexer, which will allow client code // to use [] notation on the class instance itself. // (See line 2 of ... 阅读全文
posted @ 2012-05-03 23:26 YeChun 阅读(1102) 评论(0) 推荐(0) 编辑