No, you didn't miss something...
ArrayList<String> valuesDuo = new ArrayList<String>(values);
Means, I think that it creates a new instance so it doesn't change the original. Anywhoo I tested...
Type: Posts; User: J05HYYY
No, you didn't miss something...
ArrayList<String> valuesDuo = new ArrayList<String>(values);
Means, I think that it creates a new instance so it doesn't change the original. Anywhoo I tested...
Okay, I have tested the code I gave earlier and found that it works ie. it doesn't change the original ArrayList.
ArrayList<Integer> vlinefreq = new ArrayList<Integer>();
ArrayList<Integer>...
Interesting. Maybe the code I just gave didn't work. I have just tried something only slightly more complex and it didn't work:
ArrayList<Integer> vtemplinenum = new ArrayList<Integer>();...
Yeah, in that case I need a deep copy.
Meh, no need to use clone but still a pain to cycle through every element.
vlinefreq.clear();
int x;
for (x=0; x < vfrequency.get(s).size(); x++)
{
One more last thing :P ... how do I copy an ArrayList? I tried this:
vlinefreq = vfrequency.get(s);
but it doesn't seem to work as I imagined it to.
Cheers - answered my questions exactly.
Thank you. This is what I needed. :)
... one last thing, how would I go about reassigning a new value to an existing element?
Hello,
I am new to java, these forums and know very little about object orientated programming.
I am trying to convert a C++ program to java which uses 2 dimentional vectors.
Searching google I...