Language Basics C# Book

Up casting
Up casting is a cast towards its super class or parent class.
using System;
class Person
{
public string name;
}
class Employee : Person
{
public string companyName;
}
class Program
{
static void Main(string[] args)
{
Employee e = new Employee();
e.name = "rntsoft.com";
Person p = e;
Console.WriteLine(e.name);
Console.WriteLine(p.name);

}
}
The output:
rntsoft.com
rntsoft.com