arraylist - How replace one list items with another in java? -
i have 2 array lists, can possible replace 1 list items second list.
arraylist<string> = new arraylist<string>(); arraylist<string> b = new arraylist<string>(); a.add("testone"); a.add("testtwo"); a.add("testthree"); b.add("demoone"); b.add("demotwo"); system.out.println("list values are: "+ a);
is there way replace first list second list elements. if print first array list, should print following output
[demoone, demotwo]
i guess need:
a = b; system.out.println("list values are: "+ a);
Comments
Post a Comment