Question: java Re-write Problem 2 to use a method that will produce the same output as Problem2. The program has a method called commonLetters. This method

java java Re-write Problem 2 to use a method that will produce the

Re-write Problem 2 to use a method that will produce the same output as Problem2. The program has a method called commonLetters. This method takes in two words (both are Strings) and returns a new String that contains the letters that both Strings contain in lower case (no duplicates). Hint look at the String method indexOf(charl The method header is public static String commonletters (String str1, String str2) You will test your method in the main method of your program by using a Scanner object that will read in two Strings Then call the method and pass the two Strings into the method and print the new String Sample Output Sample Input (2 Strings) Halifax Dartmouth alhi Truro Toronto Happy dancing

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!