The problem of using ArrayList

What is the value of j? 5 or 6?

posted @ Thursday, December 22, 2005 2:45 PM

Print

Comments on this entry:

# re: The problem of using ArrayList

Left by Adam at 12/22/2005 9:50 PM
Gravatar
The way you have the code written, the value of j is 1.

Did you mean int j = single.Count; ?

If so, the value would be 5, since ArrayList is a reference type and is behaving exactly as expected. If you don't want the same reference object copied around, you shouldn't be using its reference and should instead be cloning/copying it.

# re: The problem of using ArrayList

Left by Greg Young at 12/23/2005 10:44 PM
Gravatar
intresting feedback worked without the link

Your comment:



 (will not be displayed)


 
 
 
Please add 4 and 3 and type the answer here:
 

Live Comment Preview:

 
«November»
SunMonTueWedThuFriSat
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456