Question: Write a program as follows: Create two tree sets for strings using alphabetical order. Prompt the user to enter two lines of strings. Strings are

Write a program as follows:
Create two tree sets for strings using alphabetical order.
Prompt the user to enter two lines of strings. Strings are separated by spaces in a line.
Extract the strings from the first/second line and add them to the first/second tree set, respectively.
Display their union, difference, and intersection of the two tree sets. Use the set addAll, removeAll, and retainAll methods to perform union, difference, and intersection.

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 Programming Questions!