|
Post by Admin on Jun 6, 2014 21:35:02 GMT -5
using System;
public class Employee
{
public string FirstName;
public string LastName;
public void PrintFullName()
{
Console.WriteLine(FirstName + " " + LastName);
}
}
public class PartTimeEmployee : Employee
{
public new void PrintFullName()
{
base.PrintFullName();
//Console.WriteLine(FirstName + " " + LastName + " - Contractor");
}
}
public class FullTimeEmployee : Employee
{
}
public class Program
{
public static void Main()
{
FullTimeEmployee FTE = new FullTimeEmployee();
FTE.FirstName = "FullTime";
FTE.LastName = "Employee";
FTE.PrintFullName();
PartTimeEmployee PTE = new PartTimeEmployee(); // Employee PTE = new PartTimeEmployee();
PTE.FirstName = "PartTime";
PTE.LastName = "Employee";
PTE.PrintFullName(); // ((Employee)Print).PrintFullName();
}
}
|
|