Ask Question
26 October, 23:33

Which of the following could not be used to implement getLastPlusInitial () ?

a. return (lastName + ", " + firstName. substring (0, 1) + ".");

b. return (getLastName + ", " + getFirstName. substring (0, 1) + ".");

c. return (getLastName () + ", " + getFirstName (). substring (0, 1) + ".");

+3
Answers (1)
  1. 27 October, 02:55
    0
    b)

    Explanation:

    in section b) we can see that we don't have parenthesis at the end of every getter method call. for example we have a getter method for lastName as getLastName () but in return statement we don't call the getter method with parenthesis, that will cause compile time error.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Which of the following could not be used to implement getLastPlusInitial () ? a. return (lastName + ", " + firstName. substring (0, 1) + ...” 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