Question: Hi I need help with my Java assignment, thanks in advance. Re-write Problem 2 to use a method that will produce the same output as

Hi I need help with my Java assignment, thanks in advance.

Hi I need help with my Java assignment, thanks in advance. Re-write

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(char) The method header is: public static String commonLetters (String stri, 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 Input (2 Strings) Halifax Dartmouth Sample Output 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!