Consider the following class hierarchy: ``` class Animal { void makeSound() { System.out.println("Some sound"); } } class Dog extends Animal { void makeSound() { System.out.println("Bark"); } } class Cat extends Animal { void makeSound() { System.out.println("Meow"); } } ``` If we create an object like this: `Animal animal = new Dog();`, what will be printed when we call `animal.makeSound()`?




© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.

© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.