Dog
is a subclass of Animal
Dog
has a custom makeSound()
functionAnimal
instance has a makeSound()
functionDog
overrides the default initializerWay to go! Dog
is a subclass of Animal
, uses the default initializer but overrides makeSound()
, which is part of every Animal
instance.
Yikes! Dog
is a subclass of Animal
, uses the default initializer but overrides makeSound()
, which is part of every Animal
instance.