Inheritance in ASP.NET and C# Example

Inheritance is used to create new classes or objects from existing one and by extending functionality of the objects with new functionalities.
class Manager : Person
{
    Public string phoneNumber;
    Public string officeLocation;
}
//Override constructor
public Manager(string _fName, string _lName, int _age, Genders _gender, string _pNumber, string _oLocation) : base (_ftName, _lastName, _age, _gender)
{
    phoneNumber = _pNumber;
    officeLocation = _oLocation;
}
//Override ToString() method
public override string ToString()
{
    return base.ToString() + ", " + phoneNumber + ", " + officeLocation;
}