C Sharp (C#) - Interfaces
What will be the output of this code?
interface IAnimal { void Speak(); }
class Dog : IAnimal {
public void Speak() { Console.WriteLine("Woof"); }
}
class Program {
static void Main() {
IAnimal pet = new Dog();
pet.Speak();
}
}