討論串[問題] class中存取陣列元素的寫法
共 6 篇文章
首頁
上一頁
1
2
下一頁
尾頁

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者s3748679 (冷羽憶塵)時間14年前 (2011/08/13 15:44), 編輯資訊
0
0
1
內容預覽:
在下也提供一個方法,不過挺複雜的^^".. 不一定實用,看看就好.... 目的:. interface IIndexer<T>. {. T this[int index] { get; set; }. }. interface IMultList. {. IIndexer<T> Item<T>();
(還有2851個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者emn178 (小殘)時間14年前 (2011/08/13 10:02), 編輯資訊
0
0
0
內容預覽:
利用泛型先做一個通用的,以下code照邏輯打的,應該可以work. class PropertyArray<T>. {. private T[] array;. public PropertyArray(int length). {. array = new T[length];. }. publi
(還有368個字)

推噓1(1推 0噓 0→)留言1則,0人參與, 最新作者BYoYB (BYoYB)時間14年前 (2011/08/13 05:32), 編輯資訊
0
0
0
內容預覽:
請教冷羽大大:. 這個寫法好像只適合class內僅有單一成員,是嗎?. 如果有兩個以上的成員該如何解決呢?. 如:. class intList. {. private List<int> itemList = new List<int>();. private List<float> pointL

推噓1(1推 0噓 0→)留言1則,0人參與, 最新作者s3748679 (冷羽憶塵)時間14年前 (2011/08/11 11:39), 編輯資訊
0
0
0
內容預覽:
嘿~我也來仿一個... class IntList. {. private List<int> itemList = new List<int>();. public int this[int index]. {. get. {. return itemList[index];. }. set. {

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者K273 (minus)時間14年前 (2011/08/11 01:23), 編輯資訊
0
0
0
內容預覽:
class myClass{. private List<int> itemList = new List<int>();. public int[] item{. get {. return itemList.ToArray();. }. set {. itemList = new List<in
首頁
上一頁
1
2
下一頁
尾頁