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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started