Ask Question

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) + ".");

+2
Answers (1)
  1. 11 September, 04:14
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers