Question: Write a java code that tests all the question don't send the questions answers send java code TestList.java Suppose that list1 is a list that
Write a java code that tests all the question don't send the questions answers send java code TestList.java
Suppose that list1 is a list that contains the strings red, yellow, and green, andthat list2 is another list that contains the strings red, yellow, and blue. Answer the following questions by testing below in your own java code. Submit TestList.java
a. What are list1 and list2 after executing list1.addAll(list2)?
b. What are list1 and list2 after executing list1.add(list2)?
c. What are list1 and list2 after executing list1.removeAll(list2)?
d. What are list1 and list2 after executing list1.remove(list2)?
e. What are list1 and list2 after executing list1.retainAll(list2)?
f. What is list1 after executing list1.clear()?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
