Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions