Question: Using Strings Use Arrays Use Methods Some syntax that may help (that you may or may not need): To create an array (of integers for

 Using Strings Use Arrays Use Methods Some syntax that may help
(that you may or may not need): To create an array (of

Using Strings Use Arrays Use Methods Some syntax that may help (that you may or may not need): To create an array (of integers for example of size 10): int[] arr = new arr[10]; To create an array where you know the values (e.g.,5 ints): int [] arr = {1,2,3,4,5); The length of an array (called arr) is arr.length: You can also look up the String class in java's API (https://docs.oracle.com/javase/9/docs/api/index.html?overview-summary.html] Re-wite Problem 2 to use a method that will produce the same output as Problem2 The program has a method called common letters. This method takes in two words both are Strings and returns a new Sering that contains the letters that both Strings contain in lower catene duplicates Hint look at the String method indexofchar! The method header is public state Sing commonleer Singsort String 2 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 Samolenout 2 Strings Halifax Dartmouth Sample Output 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!