Click here to Skip to main content
15,896,063 members
Home / Discussions / C#
   

C#

 
GeneralRe: Dll File Pin
viciouskinid28-Oct-09 20:34
viciouskinid28-Oct-09 20:34 
GeneralRe: Dll File Pin
Christian Graus28-Oct-09 20:36
protectorChristian Graus28-Oct-09 20:36 
GeneralRe: Dll File Pin
viciouskinid28-Oct-09 20:40
viciouskinid28-Oct-09 20:40 
QuestionHow to get the child window position embeded in another window? Pin
ritz123428-Oct-09 19:07
ritz123428-Oct-09 19:07 
AnswerRe: How to get the child window position embeded in another window? Pin
Christian Graus28-Oct-09 20:28
protectorChristian Graus28-Oct-09 20:28 
Questionread data from excel Pin
TAFIN28-Oct-09 19:04
TAFIN28-Oct-09 19:04 
AnswerRe: read data from excel Pin
amaankhan28-Oct-09 19:17
amaankhan28-Oct-09 19:17 
GeneralRe: read data from excel Pin
TAFIN28-Oct-09 20:02
TAFIN28-Oct-09 20:02 
GeneralRe: read data from excel Pin
amaankhan28-Oct-09 22:00
amaankhan28-Oct-09 22:00 
QuestionOff-line Documentation Download? Pin
miss YY28-Oct-09 18:53
miss YY28-Oct-09 18:53 
AnswerRe: Off-line Documentation Download? Pin
Christian Graus28-Oct-09 20:36
protectorChristian Graus28-Oct-09 20:36 
GeneralRe: Off-line Documentation Download? Pin
miss YY28-Oct-09 21:11
miss YY28-Oct-09 21:11 
GeneralRe: Off-line Documentation Download? Pin
EliottA29-Oct-09 3:19
EliottA29-Oct-09 3:19 
GeneralRe: Off-line Documentation Download? Pin
Eddy Vluggen29-Oct-09 11:12
professionalEddy Vluggen29-Oct-09 11:12 
Questiontree view Pin
Member 59031028-Oct-09 17:38
Member 59031028-Oct-09 17:38 
AnswerRe: tree view Pin
miss YY28-Oct-09 18:56
miss YY28-Oct-09 18:56 
QuestionClient/Server and browser/Server Pin
wangzhenguo28-Oct-09 16:54
wangzhenguo28-Oct-09 16:54 
AnswerRe: Client/Server and browser/Server Pin
Christian Graus28-Oct-09 17:00
protectorChristian Graus28-Oct-09 17:00 
Questionerror simulation Pin
darthluke28-Oct-09 13:05
darthluke28-Oct-09 13:05 
Questiontranslating on-screen width to printed width Pin
TimWallace28-Oct-09 10:00
TimWallace28-Oct-09 10:00 
AnswerRe: translating on-screen width to printed width Pin
Henry Minute28-Oct-09 10:12
Henry Minute28-Oct-09 10:12 
GeneralRe: translating on-screen width to printed width Pin
TimWallace28-Oct-09 11:07
TimWallace28-Oct-09 11:07 
QuestionGeneric Collection vs ArrayList Pin
Kevin Marois28-Oct-09 9:23
professionalKevin Marois28-Oct-09 9:23 
AnswerRe: Generic Collection vs ArrayList Pin
Henry Minute28-Oct-09 9:45
Henry Minute28-Oct-09 9:45 
AnswerRe: Generic Collection vs ArrayList Pin
Paulo Zemek28-Oct-09 10:41
Paulo Zemek28-Oct-09 10:41 
ArrayList will be, in many aspects, the same as List<object>.

You can do: customers.Add(1); customers.Add("Test"); and customers.Add(cust);

When you get the value, it will be also a simple "object". So, if the Customer class has a name property, you will only be able to get the customer name doing:
((Customer)customers[0]).Name
instead of
customers2[0].Name

And, of course, you will get an exception if the first item is the 1 I added. But, the problem, you got the exception when getting the item, not when you were putting it into the list.


Also, there is more. For value types (the 1 is a value type) it will avoid boxing.
When you do arrayList.Add(1) it internally creates a full object (or box if you prefer) which contains the effective value type 1, and adds a reference to such box in the list.

If you do integerList.Add(1) (which is List<int>) you will add the 1 to the list. No reference. No additional object created.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.