Question: Write a program that reads words into two ArrayLists list1 and list2 and then creates a third ArrayList that contains words which are different between

 Write a program that reads words into two ArrayLists list1 and

Write a program that reads words into two ArrayLists list1 and list2 and then creates a third ArrayList that contains words which are different between both list1 and list2 (i.e., that are not common to both ArrayLists). You may assume that the strings are entered by the user as words separated by a space on a single line and the end is signaled by the String "-1". You can use the next() method in class Scanner to read each word. A sample dialog is shown below: Enter words on one line, end with -1 java c pascal ada python java c++ -1 Enter words on one line, end with -1 c pascal lisp java lisp rust go -1 Array List with distinct strings: [ada, python, c++, lisp, rust, go]

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!