Ask Question
22 June, 11:47

The class Name consists of 4 instance data, String title, String first, Stringmiddle, and String last. The class has a constructor that is passed all 4 String values and initializes the class appropriately. It has 4 methods and each returns one of the four instance data, calledreturnTitle (), returnFirst (), returnMiddle and returnLast ().

Name[] addressBook = new Name[100]; is performed.

Write a method that is passed 4 String parameters corresponding to the title, first, middle, and last ofName, and finds this Name in addressBook and returns the index of where this Name was found, or - 1 if theName was not found. Assume that addressBook stores n entries (n is an int).

+1
Answers (1)
  1. 22 June, 13:31
    0
    Answer: public int findName (String title, String first, String middle, String last

    {

    for (int j=0; j
    first. equals (addressBook[j]. getFirst () && middle. equals (addressBook[j]. getMiddle () && last. equals (addressBook[j]. getLast ())

    return j;

    return - 1;

    Explanation: Mark me As brainliest
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “The class Name consists of 4 instance data, String title, String first, Stringmiddle, and String last. The class has a constructor that is ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers