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();
}
}
}
Is this overriding of Print() Method ?
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Raja TRank #685 · 3.5K reputationPosted Jul 14, 2015, 11:51 PM EDT
please refer bellow url
Guest UserRank #816 · 2.8K reputationPosted Jul 14, 2015, 11:41 PM EDT
{
{
Console.WriteLine("I'm a Parent Class.");
}
{
{
Console.WriteLine("I'm a Child Class.");
}
Ashwani Chaudhary171 reputationPosted Jul 15, 2015, 4:53 AM EDT