// Create a subclass and access base class functionality.
static void Main(string[] args)
{
Console.WriteLine("***** The Employee Class Hierarchy *****\n");
SalesPerson danny = new SalesPerson();
danny.Age = 31;
danny.Name = "Danny";
danny.SalesNumber = 50;
Console.ReadLine();
}
Controlling Base Class Creation with the base Keyword
Currently, SalesPerson and Manager can only be created using the freebee default constructor (see
Chapter 5). With this in mind, assume you have added a new six-argument constructor to the
Manager type, which is invoked as follows:
static void Main(string[] args)
{
...
Do'stlaringiz bilan baham: |