Question: Write a Java program, called LinearSearch2, that contains a static method called countStrings() that accepts a 2D array of Strings and a String as its

 Write a Java program, called LinearSearch2, that contains a static method
called countStrings() that accepts a 2D array of Strings and a String
as its parameters. The method should return an integer value that is

Write a Java program, called LinearSearch2, that contains a static method called countStrings() that accepts a 2D array of Strings and a String as its parameters. The method should return an integer value that is the total number of times the String being searched for is contained in the 2D String array. In the main method you should use user input to take the element you wish to search for in the array. There is code there for your array. DO NOT CHANGE THIS CODE. You should print an appropriate message to the screen if the element is found and how many times it exists in the array. Note: The countStrings() method should work irrespective of case. Sample Input 1 Duck Sample Array 1 cat dog duck rabbit hen duck cat dog dUck rabbit hen duck dUcK Duck goose public c1ass Linearsearch? public static void main (string args[l]) string words[]] = {{ "cat", "dog", "duck" },{ "rabbit", "hen", "duck" },{ "duck", "Duck", "goose" }; )

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!