下面类的索引定义或使用正确的是()。

大学网课 已帮助 人

下面类的索引定义或使用正确的是()。

A.class MyClass{ int x; int y; public int this[int index] { get{ if (index==0) return x; else return y; } } }

B.class MyClass{ int x; int y; public int this[int index] { set{ if (index==0) x=value; else y=value; } } }

C.class MyClass{ int x; int y; public int INDEX[int index] { get{ if (index==0) return x; else return y; } set{ if (index==0) x=value; else y=value; } } }

D.class MyClass{ int x; int y; public int this[int in

下面类的索引定义或使用正确的是()。

热搜:下列有关视图和索引的说法正确的是