You can use retainAll
method:
columnsOld.retainAll (columnsNew);
More Related Contents:
- Intersection and union of ArrayLists in Java
- How to arrange the datas to display in array by given string of days in java?
- Java Questions! About List and Objects
- Which Lists will/won’t compile?
- How to sort a List/ArrayList?
- How do you cast a List of supertypes to a List of subtypes?
- Is there a concurrent List in Java’s JDK?
- Java List.add() UnsupportedOperationException
- In Java how do you sort one list based on another?
- What is the difference between Set and List?
- How can I sort a List alphabetically?
- UnsupportedOperationException when trying to remove from the list returned by Array.asList
- How can I access a folder inside of a resource folder from inside my jar File?
- How to shuffle an ArrayList [duplicate]
- How to search in a List of Java object
- How to cast from List to double[] in Java?
- Difference between Iterator and Listiterator?
- Best way to concatenate List of String objects? [duplicate]
- Java: Casting from List to List when B implements A?
- Intersection of two strings in Java
- Create a List of primitive int?
- Efficiently finding the intersection of a variable number of sets of strings
- Java Sort List of Lists
- Why can’t you have a “List” in Java? [duplicate]
- What kind of List does Collectors.toList() return?
- How to convert a List into a comma separated string without iterating List explicitly [duplicate]
- std::vector to java.util.Vector code generation with swig
- What’s the difference between unbounded wildcard type List and raw type List?
- Performance and Memory allocation comparison between List and Set
- Converting an int array to a String array