Using Eclipse, create a New Java project named YourNameCh20Project-- for example, I would name my Project YourNameCh20Project
Create a new class named YourInitialsCh20App. – for example, I would name my class YNCh20App.
Write a program that prompts the user to enter two lines of words. The words are separated by spaces. Extract the words from the two lines into two lists. Display the union, difference, and intersection of the two lists in ascending alphabetical order.
Here is a sample run:
Enter the first line: red green blue yellow purple cyan orange
Enter the second line: red black brown cyan orange pink
The union is [black, blue, brown, cyan, cyan, green, orange, orange, pink, purple, red, red, yellow]
The difference is [blue, green, purple, yellow]
The intersection is [cyan, orange, red]
Your name must be displayed on line 1 of the class.
All variables must begin with your initials in camelCasing. For example, I would name my variables ynInput, ynLine1, ynLine2, ynWords, ynList1, ynList2, ynTemp
Hint: You will use an Arrays, ArrayLists , and List