Question: Write the following merhods in a Java class 5. Write a static method called replaceString that takes in an array of Strings, a String to

Write the following merhods in a Java class
Write the following merhods in a Java class 5. Write a static

5. Write a static method called replaceString that takes in an array of Strings, a String to find, and a String to replace it with. It then replaces all instances of the first string with the second string. For example, given an array ("grains", "meat", "dessert", "fruit", "vegetables"), and strings "dessert" and "more vegetables", the method would return ["grains", meat", "more vegetables", "fruit", "vegetables"). 6. Write a static method called reverse that takes in an array, and reverses it. For example, given [1, 2, 3, 4], the method would return [4, 3, 2, 1). You may need to use another array

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!