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 (or Collection)
- 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?
- why is it that we can’t use ArrayList.get(-1) to get the last element of the ArrayList in java? it works in python though [closed]
- How to arrange the datas to display in array by given string of days in java?
- ArrayList Data Structure – Daily Temperature
- I am new in using ArrayLists. Array Out of Bounds, Array seems to be empty, but have been adding Strings to it already
- When to use LinkedList over ArrayList in Java?
- Which Java Collection should I use?
- Why start an ArrayList with an initial capacity?
- Java: Detect duplicates in ArrayList?
- Variable length (Dynamic) Arrays in Java
- Delete data from ArrayList with a For-loop
- Performance of traditional for loop vs Iterator/foreach in Java
- How to get the last value of an ArrayList
- Firebase Firestore get data from collection
- Java – Removing duplicates in an ArrayList
- When does HashSet ‘add’ method calls equals? [duplicate]
- Concurrent threads adding to ArrayList at same time – what happens?
- Modifier static is only allowed in constant variable declarations
- Fastest way to recreate the ArrayList in a for loop
- How to insert an object in an ArrayList at a specific position
- Removing Duplicate Values from ArrayList
- java.lang.IllegalArgumentException: Comparison method violates its general contract [duplicate]
- How can I create an array in Kotlin like in Java by just providing a size?
- Comparing two hashmaps for equal values and same key sets?
- Iterate ArrayList in JSP
- Passing ArrayList of string arrays from one activity to another in android