Home » Tip Bank » Java
  • Comment on this Article
Language: Java
Expertise: Intermediate
Apr 27, 2020

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Watch

Cloning a List

Cloning a List in Java can be done as shown below:

List newArrayList = (ArrayList) oldArrayList.clone();

Or, even better, just create a new List:

List strs;
...
List newStrs = new ArrayList(strs);
Octavia Anghel
 
Submit a Tip
Browse "Java" Tips
Browse All Tips
activatejavascript.org
html.net