There is a method called containsAll
declared in the java.util.Collection
interface. In your setting one.containsAll(two)
gives the desired answer.
More Related Contents:
- Check if an ArrayList contains every element from another ArrayList
- ArrayList’s custom Contains method
- Using contains on an ArrayList with integer arrays
- Check if a value exists in ArrayList
- Finding out if a list of Objects contains something with a specified field value?
- Check to see if two arraylists contain a similar component [duplicate]
- Get ArrayList entry of a HashMap Entry [closed]
- How can I avoid ArrayIndexOutOfBoundsException or IndexOutOfBoundsException? [duplicate]
- How to compare dates in Java? [duplicate]
- Converting ‘ArrayList to ‘String[]’ in Java
- Gson TypeToken with dynamic ArrayList item type
- How to avoid java.util.ConcurrentModificationException when iterating through and removing elements from an ArrayList
- Integer wrapper class and == operator – where is behavior specified? [duplicate]
- How do I make my string comparison case-insensitive?
- How to use an arraylist as a prepared statement parameter [duplicate]
- How to use an array list in Java?
- list.clear() vs list = new ArrayList(); [duplicate]
- make arrayList.toArray() return more specific types
- List versus ArrayList as reference type?
- Remove Item from ArrayList
- String contains – ignore case [duplicate]
- Understand Arraylist IndexOutOfBoundsException in Android
- How can I calculate the difference between two ArrayLists?
- Time complexity for java ArrayList
- Is it valid to compare a double with an int in java?
- Why is Java’s Double.compare(double, double) implemented the way it is?
- Comparing Numbers in Java
- Read data from CSV file into ArrayList and display in XY Chart
- Does the capacity of ArrayList decrease when we remove elements?
- Removing object from ArrayList in for each loop