索引是使用this关键字来引入的,this关键词之前要指定返回值的类型,在后面的方括号中要指定索引器的索引使用值的类型;一个雷或节后中只能有一个索引;
public bool this [int index] { get{}set{} }
接口中的索引:
interface Ia{ bool this [int index]{get;set;} }
posted on 2015-04-04 14:34 阴晴撒哈拉 阅读(94) 评论(0) 编辑 收藏 举报