0 votes
1 view
in Java by (4.1k points)

Here are the conditions: do not modify the original lists; JDK only, no external libraries.one-liner or a JDK 1.3 version is preferred. 

Is there a simpler way than:

List<String> newList = new ArrayList<String>();



1 Answer

0 votes
by (46.1k points)

Here's one linear which fulfills all the conditions mentioned by you:

List<String> newList = new ArrayList<String>(listOne);


click here to read more about it.

Related questions

Welcome to Intellipaat Community. Get your technical queries answered by top developers !