Ask Question
21 November, 06:04

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. 21 November, 09:37
    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?
Get 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 & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers