|
-
Jun 3rd, 2006, 01:02 PM
#1
Thread Starter
Hyperactive Member
[1.0/1.1] Copying an ArrayList to another
Hi. I'm passing an arraylist to a method in which I want to copy it. I did it as:
ArrayList al....
add values to al....
call method: method(al)
...
another class:
ArrayList te;
.....
public void method(ArrayList al)
{ te = al;
}
Now it is assigning, but if I'm back in the original class and I change ArrayList al, the value of te is also changing. Does anyone knows how to fix this problem? I just want to copy the value of al to te in the method, not the actual pointer to the ArrayList.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|