G
Guest
Given:
ArrayList al=new ArrayList();
int i=1;
al.Add(i);
How can I change the value of al[0] to 2?
(without removing the object and then adding a new one)
This won't work, since int is an value type object:
int k=(int) al[0];
k=2; //(al[0] is not updated since k is a not a referrence to it
Is it possible?
Best Regards
Karl Daggfeldt
ArrayList al=new ArrayList();
int i=1;
al.Add(i);
How can I change the value of al[0] to 2?
(without removing the object and then adding a new one)
This won't work, since int is an value type object:
int k=(int) al[0];
k=2; //(al[0] is not updated since k is a not a referrence to it
Is it possible?
Best Regards
Karl Daggfeldt