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     }

 

 

相关文章:

  • 2021-06-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-05
  • 2022-12-23
猜你喜欢
  • 2021-05-31
  • 2021-10-14
  • 2022-01-08
  • 2022-12-23
  • 2021-09-24
  • 2022-02-02
  • 2021-06-22
相关资源
相似解决方案