Geeks With Blogs
Greg Young Greg.ToString()

I am putting this here since feedback seems to be broken at this point.

 

this is in reference to .. http://geekswithblogs.net/royhwa/archive/2005/12/22/63855.aspx

 

I am not quite sure what you are on about ...

the value of J is neither 5 nor 6 it is 1.


   ArrayList sets = new ArrayList();

Creates a new array list

   sets.Add(single);

Adds the previous arraylist into this arraylist i.e. sets[1] = the arraylist

   ArrayList temp = (ArrayList) sets[0];

   temp.RemoveAt(0);
//removes the item from the first arraylist

 

perhaps you are looking for the AddRange() method ?! http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemcollectionsarraylistclasscopytotopic.asp


 

Posted on Thursday, December 22, 2005 8:54 AM | Back to top


Comments on this post: Feedback broken so ...

# re: Feedback broken so ...
Requesting Gravatar...
3ks for your answer.

The value of j is 5.
And ArrayList is reference object.
Left by Royhwa on Dec 23, 2005 12:57 PM

# re: Feedback broken so ...
Requesting Gravatar...
ok before you start telling me this ... GO RUN THE CODE

string [] str = {"1","2","3","4","5","6"};
ArrayList single = new ArrayList();
for(int i=0;i<str.Length;i++) {
single.Add(str[i]);
}
ArrayList sets = new ArrayList();
sets.Add(single);
ArrayList temp = (ArrayList) sets[0];
temp.RemoveAt(0);
int j = sets.Count;

j!=5 j==1

and its because the reasons I mention above.
Left by Greg Young on Dec 23, 2005 1:14 PM

Your comment:
 (will show your gravatar)


Copyright © Greg Young | Powered by: GeeksWithBlogs.net