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 program to find factorial of a number
  • java download files from url with password
  • add a list to onother list in java
  • how to customize python tkinter
  • how to download a directory from ftp server using sun.net java
  • Auto Box function java
  • perl program for factorials
  • convert string to unicode python
  • java reverse words in a string

No comments yet.

Leave a Comment