Question: Write an interactive Java program that prompts for and reads two strings each containing distinct characters [Note: You are not required to check this, assume

Write an interactive Java program that prompts for and reads two strings each containing distinct characters [Note: You are not required to check this, assume each string input has distinct characters]. The program then creates a string which is the intersection of the two input strings. If the intersection is empty, the following is displayed: The intersection is Note: The behaviour of your program must be similar to the sample program runs below: Sample program runs Enter string1 of distinct characters: best road Enter string2 of distinct characters: this boy. The intersection is: bst o. Enter stringi of distinct characters: black pen Enter string2 of distinct characters: redpot The intersection is: pe Enter string1 of distinct characters: Enter string2 of distinct characters: The intersection is: JAVA Enter stringl of distinct characters: qwerty Enter string2 of distinct characters: OWERTY Enter stringl of distinct characters: q Enter string2 of distinct characters: The intersection is empty: h JAVA AVA qwerty QWERTY
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
