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:

  • java commands to underline in frame
  • program to calculate to the power of number in perl
  • Auto Box function java
  • java add one list to another
  • add a list to onother list in java
  • how do we flip a picture horizontally in java in a simple way
  • javamail print headers
  • scriptenginemanager execute function
  • java AWT gui examples 2013
  • perl calculate in print statement

No comments yet.

Leave a Comment