interface ISpeak
{
void Speak();
}
class Animal : ISpeak
{
public void Speak()
{
Console.WriteLine("Animal is speaking. . .");
}
}
class Program{
void Main(){
Animal animal = new Animal();
Animal.Speak();
}
}
And My question:
I create a new obj here: ISpeak animal = new Animal();
And then I call the Speak method: animal.Speak();
The result is the same as the original code, so what is the difference btween ISpeak animal = new Animal();
and Animal animal = new Animal();