推 qwer820404:List有泛型<T> .. 但是ArrayList只有object collection 01/20 15:23
→ qwer820404:ArrayList無法規範型別 只能取出的時候轉型 01/20 15:24
→ qwer820404:也許要判斷存在ArrayList裡面的物件類型 typeof 01/20 15:26
我的確是可以在使用ArrayList[i]的時候再強制轉型,
例如:((product)ArrayList[i]).xxx
但這樣寫感覺好蠢.....
※ 編輯: youneverknow 來自: 111.67.63.123 (01/20 15:29)
→ iterator:怎麼會覺得 List<T> 有先天很慢的問題呢? 01/20 15:59
推 a926:list很慢有文章參考嗎@@ 01/20 16:04
→ ssccg:List先天很慢是哪來的? ArrayList基本上就是List<Object>吧 01/20 16:31
→ ssccg:.net的List<T>底層一樣是array做的啊 01/20 16:34
→ ssccg:看到你提到vector,是指C++的? 所以你以為List是LinkedList? 01/20 17:23
→ ssccg:.net另外有個叫LinkedList的class,List就只是泛型ArrayList 01/20 17:25
推 mepowerlmay:要比應該拿dictionary 跟 list比速度 01/20 20:05
推 YahooTaiwan:List<T>哪裡惹到你 要這樣排擠它 01/20 20:53
小弟C#新手,的確以為List就是C++的List,
那個每次一定要從頭爬的速度怪物,
所以不是嗎?
※ 編輯: youneverknow 來自: 118.160.218.197 (01/20 23:25)