Question: For each question, make sure to show your work, i.e., how you come up with your answers. 5. (10 pts) Suppose that set1 (Set )

For each question, make sure to show your work, i.e., how you come up with your answers.

5. (10 pts) Suppose that set1 (Set) is a LinkedHashSet that contains the strings red, yellow, green, and that set2 (Set) is another LinkedHashSet that contains the strings red, yellow, blue. Answer the following questions (All the questions are independent to each other):

What is set1 after executing set1.addAll(set2)?

What is set1 after executing set1.add(set2)?

What is set1 after executing set1.removeAll(set2)?

What is set1 after executing set1.remove(set2)?

What is set1 after executing set1.retainAll(set2)?

What is set1 after executing set1.clear()?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!