namespace ConsoleApplication13
{
using System;
public class Parent
{
string parentString;
public Parent()
{
Console.WriteLine("Parent Constructor.");
}
public void print()
{
Console.WriteLine("I'm a Parent Class.");
}
}
public class Child : Parent
{
public Child()
{
Console.WriteLine("Child Constructor.");
}
public new void print()
{
Console.WriteLine("I'm a Child Class.");
}
public static void Main()
{
Child child = new Child();
child.print();
((Parent)child).print();
Console.ReadLine();
}
}
}
Loading

Raja TPosted Jul 15, 2015, 3:51 AM
please refer bellow url
Ashwani ChaudharyPosted Jul 15, 2015, 8:53 AM
Guest UserPosted Jul 15, 2015, 3:41 AM
{
{
Console.WriteLine("I'm a Parent Class.");
}
{
{
Console.WriteLine("I'm a Child Class.");
}