C Sharp (C#) - Inheritance
Given these classes:
What is the output of
class Animal {
public virtual string Speak() => "Animal sound";
}
class Dog : Animal {
public override string Speak() => base.Speak() + " and Bark";
}
class Puppy : Dog {
public override string Speak() => base.Speak() + " and Whine";
}What is the output of
new Puppy().Speak()?