public static void Main() { MainClass s; s = new ChildClassOne(); s.NameFunct(); s = new ChildClassTwo(); s.NameFunct(); }
static void Main(string[] args) { Parent ObjParent = new Parent(); Parent ObjChildClassOne = new ChildClassOne(); Parent ObjChildClassTwo = new ChildClassTwo(); ObjParent.ParentFunct(); ObjChildClassOne.ParentFunct(); ObjChildClassTwo.ParentFunct(); }