In Java 8:
List<String> newList = Stream.concat(listOne.stream(), listTwo.stream())
.collect(Collectors.toList());
More Related Contents:
- get Index of last Element in list without using lastIndexOf() or any other Java/String- Methods [closed]
- ArrayList, Loop and requisite if can not work that i want – Java 11
- How do I remove repeated elements from ArrayList?
- Arrays.asList() not working as it should?
- Array or List in Java. Which is faster?
- Intersection and union of ArrayLists in Java
- Why am I not getting a java.util.ConcurrentModificationException in this example?
- How to convert List to Map?
- How to print out all the elements of a List in Java?
- How to set a JVM TimeZone Properly
- What is the difference between List and ArrayList? [duplicate]
- How can I access a folder inside of a resource folder from inside my jar File?
- How to initialize List object in Java?
- Working with a List of Lists in Java
- How to pick an item by its probability?
- Get unique values from ArrayList in Java
- Modifier static is only allowed in constant variable declarations
- How to have Java method return generic list of any type?
- Is there a no-duplicate List implementation out there?
- how to get list of Databases “Schema” names of MySql using java JDBC
- What is the difference between List.of and Arrays.asList?
- Convert Iterator to List
- How to convert list data into json in java
- Arrays.asList(int[]) not working [duplicate]
- Component for filtering a list
- Check if one list contains element from the other
- How to generate the power-set of a given List?
- How to transform List to another List [duplicate]
- Nested lists with streams in Java8
- java : Understanding Arrays.asList(T…array) method for primitive types