Created
April 11, 2012 11:54
-
-
Save tnngo2/2358859 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
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