Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java: How to copy Elements of One ArrayList to Another ArrayList

Java: How to copy Elements of One ArrayList to Another ArrayList
{filelink=4856}

import java.util.ArrayList;
import java.util.Collections;
public class Ex_ArrayL
{
  public static void main(String[] args) {
    ArrayList array_L1 = new ArrayList();
    array_L1.add("1");
    array_L1.add("2");
    array_L1.add("3");
    ArrayList array_L2 = new ArrayList();
    array_L2.add("A");
    array_L2.add("B");
    array_L2.add("C");
    array_L2.add("D");
    System.out.println(array_L2);
    Collections.copy(array_L1, array_L2);
    System.out.println(array_L2);
  }
}

Users who found this page were searching for:

  • python read characters from file
  • perl calculate in print statement
  • program to calculate to the power of number in perl
  • add a list to onother list in java
  • perl calculate the difference between two times
  • Auto Box function java
  • how to underline text in jlabel
  • copy arraylist to another arraylist java without collections
  • java add one list to another
  • java commands to underline in frame

No comments yet.

Leave a Comment