The indexer (C # programming guide) in the interface can be declared on the interface (C # reference. The accessors of the interface indexer are different from those of the class indexer in the following aspects: the interface accessors do not use modifiers. The interface accessor has no body. Therefore, the accessors are used to indicate whether the indexer is read/write, read-only, or write-only. The following is an example of the interface indexer accesser: C # copy the code public interface isomeinterface {//... // indexer Declaration: stringthis [int Index] {Get; Set ;}} the signature of an indexer must be different from the signature of all other indexers declared in the same interface. The following example shows how to implement the interface indexer. C # copy the code // indexer on an interface: public interface isomeinterface {// indexer Declaration: intthis [int Index] {Get; Set ;}// implementing the interface. class indexerclass: isomeinterface {privateint [] arr = newint [100]; publicintthis [int Index] // indexer declaration {get {// check the index limits. if (index <0 | index> = 100) {return 0;} else {return arr [Index] ;}} set {If (! (Index <0 | index> = 100) {arr [Index] = value ;}}} class mainclass {staticvoid main () {indexerclass test = new indexerclass (); // call the indexer to initialize the elements #2 and #5. test [2] = 4; test [5] = 32; For (INT I = 0; I <= 10; I ++) {system. console. writeline ("element #{0 }={ 1}", I, test [I]) ;}} output element #0 = 0 element #1 = 0 element #2 = 4 element #3 = 0 element #4 = 0 element #5 = 32 element #6 = 0 element #7 = 0 element #8 = 0 element #9 = 0 element #10 = 0 in the preceding example, you can use an explicit interface member by using the fully qualified name of the interface member. For example: Public String isomeinterface. This {}. However, to avoid ambiguity, you must use a fully qualified name only when the class uses the same indexer signature to implement more than one interface. For example, if the employee class implements two interfaces icitizen and iemployee, and these two interfaces have the same index signature, you must use an explicit interface member. That is, the following index Declaration: Public String iemployee. this {} implements the indexer on the iemployee interface, and the following declaration: Public String icitizen. this {} implements the indexer on the icitizen interface. (Source: msdn)