Question 4
Back to Exercise
Animal.describe() calls self.speak(); Dog overrides speak(). Which speak runs for Dog().describe()?
- A Animal.speak – describe is defined in Animal
- B Both
- C Neither; it raises an error
- D Dog.speak – self is the Dog object Correct
Correct Answer: Option D
Method lookup starts at the object's actual class, wherever the calling code lives.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!