“`参数的个数和类型都是任意的。加分的补充回答:用reflector反编译可以看出,索引器的内部本质上就是set_item、get_item方法。

基础知识:

索引的语法:

public string this[string s],通过get、set块来定义取值、赋值的逻辑

索引可以有多个参数、参数类型任意

索引可以重载。

如果只有get没有set就是只读的索引。

索引其实就是set_Item、get_Item两个方法。

 

“`

Was this helpful?

0 / 0

发表回复 0

Your email address will not be published.