Skip to content

Instantly share code, notes, and snippets.

@tnngo2
Created April 13, 2012 04:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tnngo2/2373593 to your computer and use it in GitHub Desktop.
Save tnngo2/2373593 to your computer and use it in GitHub Desktop.
public abstract class Abstract_Animal
{
public void Eat()
{
Console.WriteLine("Every animal eats food in order to survive");
}
public abstract void AnimalSound();
}
public class Lion:Abstract_Animal
{
public override void AnimalSound()
{
Console.WriteLine("Lion roars");
}
static void Main(string[] args)
{
Lion obj = new Lion();
obj.AnimalSound();
obj.Eat();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment