Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Arraylist1{"this", "is", "a", "coding", "test"};
- Arraylist2{"this", "is", "random1", "a", "random2", "coding", "random3", "test"};
- "this" "is" "a" "coding" "test"
- list1.contains(list2.get(i)))
- Iterator<String> List1_Iterator = List1.iterator();
- while (List1_Iterator.hasNext()) {
- }
- List<Integer> list1 = Arrays.asList(1,3,5);
- List<Integer> list2 = Arrays.asList(1,2,3,4,5);
- ArrayList<Integer> list2Copy = new ArrayList<>(list2);
- list2Copy.removeIf(x -> !list1.contains(x));
- System.out.println(list1.equals(list2Copy));
Add Comment
Please, Sign In to add comment