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 it just to make sure it works:
import java.util.ArrayList;
class mainprogram
{
public static void main(String args[])
{
ArrayList<Integer> vlinefreq = new ArrayList<Integer>();
ArrayList<Integer> vfrequency = new ArrayList<Integer>();
vlinefreq.add(1);
vlinefreq.add(2);
vlinefreq.add(3);
vfrequency = new ArrayList<Integer>(vlinefreq);
System.out.println("OldLineFreq = " + vlinefreq);
System.out.println("OldFrequency= " + vfrequency);
vlinefreq.set(0,5);
System.out.println("NewLineFreq = " + vlinefreq);
System.out.println("NewFrequency =" + vfrequency);
}
}
Output:
OldLineFreq = [1, 2, 3]
OldFrequency= [1, 2, 3]
NewLineFreq = [5, 2, 3]
NewFrequency =[1, 2, 3]
... good stuff, cheers to both of you