ArrayList.clone()
« ArrayList
ArrayList.clone() Create shallow clone of the ArrayList.
« add()
Examples with output
ArrayList<String> languages = new ArrayList<String>();
languages.add("Java");
languages.add("PHP");
languages.add("Python");
System.out.println(languages); //[Java, PHP, Python]
ArrayList languages2= new ArrayList();
languages2=(ArrayList)languages.clone();
System.out.println(languages2); //[Java, PHP, Python]
« ArrayList Tutorials
This article is written by plus2net.com team.
plus2net.com