Why does calling the PrintFullName() method require casting it as ((Employee)PTE).PrintFullName() ?

Hi, I have two classes where one inherits from the other. Here's the code. My question is: why do I need to cast the method PrintFullName() when calling it as ((Employee)PTE).PrintFullName()? Why can't it be cast directly like (Employee)PTE.PrintFullName()?
c#
public class Employee 
{
    public string? firstName;
    public string? lastName;

    public virtual string PrintFullName()
    {
        //Console.WriteLine(firstName + " " + lastName);

        return firstName + " " + lastName;
    }
}

public class PartTimeEmployee: Employee 
{
    public new string PrintFullName() 
    {
        return firstName + " " + lastName + " "  + "contractor";
    }
}

c#
      PartTimeEmployee PTE = new PartTimeEmployee();
      PTE.firstName = "parttime";
      PTE.lastName = "Employee";
      ((Employee)PTE).PrintFullName();
Was this page helpful?