Created
April 13, 2012 04:07
-
-
Save tnngo2/2373593 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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