Public class parentclass {public parentclass () {} Public String namepropety {Get; set;} public void getname () {}} public class childclass: parentclass {public childclass () {} public int age {Get; set;} public int getage () {return 10 ;}} parentclass parent = new parentclass (); // parent. namepropety // parent. getname (); // Child class to parent class. // Parentclass parent1 = new childclass (); or parentclass parent1 = new childclass () as parentclass; // parent1.namepropety // parent1.getname (); childclass child = new childclass (); // child. namepropety // child. getname (); // child. getage (); // child. age; // parent class rotor class. // Child1 is a null object. // Childclass Child1 = new parentclass () as childclass; or childclass Child1 = (childclass) New parentclass (); // console. writeline (child1.namepropety); // child1.getname (); // child1.getage (); // child1.age;