public object this[int i]{ get { return 1; } } public object Item{ get { return 1; }}這段代碼不能通過編譯,編譯器把索引器this[int i]{get;}編譯成get_Item(),所以無法再次定義一個Item屬性(Item屬性也被編譯成get_Item()),現在問題是,Item屬性是實現某個接口,而我自己必須用索引器,有什么辦法嗎?(就是說非要使用索引器同時申明Item屬性)
- 2 回答
- 0 關注
- 457 瀏覽
添加回答
舉報
0/150
提交
取消
