Skip to content

Instantly share code, notes, and snippets.

@tnngo2
Created April 11, 2012 11:54
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/2358859 to your computer and use it in GitHub Desktop.
Save tnngo2/2358859 to your computer and use it in GitHub Desktop.
class Employees
{
int _empId = 1;
string _empName = "James Anderson";
int _age = 25;
public void Display()
{
Console.WriteLine("Employee ID: " + _empId);
Console.WriteLine("Employee Name: " + _empName);
}
}
class Department : Employees
{
int _deptId = 501;
string _deptName = "Sales";
new void Display()
{
base.Display();
Console.WriteLine("Department ID: " + _deptId);
Console.WriteLine("Department Name: " + _deptName);
}
static void Main(string[] args)
{
Department objDepartment = new Department();
objDepartment.Display();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment