Ask Question
14 August, 07:12

Which of the following can you not code in a subclass? Select one: a. a method with the same signature as a method in the superclass b. a call to a constructor of the superclass c. a method that's not defined by the superclass d. a call to a private method of the superclass

+3
Answers (1)
  1. 14 August, 08:48
    0
    Option D: a call to a private method of the superclass

    Explanation:

    Option a: a method with the "same signature" is allowed in the subclass. There will not be any confusion because the object which is trying to call the method will decide whether to call the sub class or super class.

    Option b: a call to a super class constructor is possible because, when you create an object of sub class automatically the super class constructor will be called. Even the sub class constructor can call the super class constructor explicitly.

    Option c: A subclass can create method that's not defined by the super class

    Option D: a private method is private inside the class and hence even the object of that class cannot access.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Which of the following can you not code in a subclass? Select one: a. a method with the same signature as a method in the superclass b. a ...” 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