Skip to content

Instantly share code, notes, and snippets.

@tnngo2
Created April 11, 2012 11:42
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/2358827 to your computer and use it in GitHub Desktop.
Save tnngo2/2358827 to your computer and use it in GitHub Desktop.
class Animal1
{
protected string Food;
protected string Activity;
}
class CatProtected : Animal1
{
static void Main(string[] args)
{
CatProtected objCat = new CatProtected();
objCat.Food = "Mouse";
objCat.Activity = "Laze around";
Console.WriteLine("The Cat loves to eat " + objCat.Food);
Console.WriteLine("The Cat loves to " + objCat.Activity);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment