Created
April 13, 2012 07:53
-
-
Save tnngo2/2374963 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
interface IAnimal2 | |
{ | |
void Drink(); | |
} | |
interface ICarnivorous | |
{ | |
void Eat(); | |
} | |
interface IReptile: IAnimal2, ICarnivorous | |
{ | |
void Habitat(); | |
} | |
class Crocodile2:IReptile | |
{ | |
public void Drink() | |
{ | |
Console.WriteLine("Crocodiles drink fresh water"); | |
} | |
public void Habitat() | |
{ | |
Console.WriteLine("Can stay in water and land"); | |
} | |
public void Eat() | |
{ | |
Console.WriteLine("Eat flesh"); | |
} | |
static void Main(string[] args) | |
{ | |
Crocodile2 objCrocodile = new Crocodile2(); | |
objCrocodile.Habitat(); | |
objCrocodile.Eat(); | |
objCrocodile.Drink(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment