Question: java Write a method to find if a name is on an array of Strings. Your method will search the array and return the index
java
Write a method to find if a name is on an array of Strings. Your method will search the array and return the index of the first occurrence of the name. If the name is not on the list, the method should return -1. The method signature must be: public static int findName(Stringl], String) There is no I/O for this question. All tests are unit tests. If the first test is not passing all other tests will fail. Make sure you have the method's header correct before proceeding. Example: Method's return Names Array "Athur","John","Clark"} "Athur","John","Clark"} Name to find Clark Joe -1
Step by Step Solution
There are 3 Steps involved in it
To solve this problem you need to write a Java method that will return the index of the first occurr... View full answer
Get step-by-step solutions from verified subject matter experts
