“Upcasting” means moving subclass object to the parent class object. “DownCasting” is opposite to “Upcasting” moving the parent object to the child object.
class GoldCustomer : Customer
Below is an “upcasting” code where the child parent class gold customer is pushed to the customer class.
Customer obj = new GoldCustomer();
Below is a sample of “downcasting” code where parent class object is tried to move to a child class object, this is not allowed in .NET.
GoldCustomer obj = new Customer(); // not allowed illegal