Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedjava

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

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

Step: 3

blur-text-image

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

Public Finance

Authors: Harvey S. Rosen

5th Edition

025617329X, 978-0256173291