Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Datacasting How To Stream Databases Over The Internet

Authors: Jessica Keyes

1st Edition

007034678X, 978-0070346789

More Books

Students also viewed these Databases questions