C#代码示例_集合

C#中数组实现为System.Array类得实例,它们只是集合类(Collection Classes)中的一种类型。

索引符(indexer)是一种特殊类型的属性,可以把它添加到一个类中,以提供类似于数组的访问。如:在Animal对象的Animals集合中添加一个索引符。

 1     public interface IMyInterface
 2     {
 3         void DoSomething();
 4         void DoSomethingElse();
 5     }
 6 
 7     public class MyClass : IMyInterface
 8     {
 9         void IMyInterface.DoSomething()
10         { 
11         }
12         public void DoSomeThingElse()
13         { 
14         }
15     }