Blog Stats
  • Posts - 99
  • Articles - 5
  • Comments - 42
  • Trackbacks - 108

 

Feedback broken so ...

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


 


Feedback

# re: Feedback broken so ...

Gravatar 3ks for your answer.

The value of j is 5.
And ArrayList is reference object. 12/23/2005 12:57 PM | Royhwa

# re: Feedback broken so ...

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. 12/23/2005 1:14 PM | Greg Young

Post a comment





 

Please add 5 and 3 and type the answer here:

 

 

Copyright © Greg Young