The problem of using ArrayList

What is the value of j? 5 or 6?

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
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:



(not displayed)


 
 
 
 
 

Live Comment Preview:

 
«February»
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910