Interviews2 answers
What is new keyword in case of method hiding?
2 Answers
new
Mukesh KumarPosted Aug 28, 2017, 5:41 AM EDT
New Keyword
New keyword is also used in polymorphism concept, but in the case of method overloading So what does overloading means, in simple words we can say procedure of hiding your base class through your derived class.
It is implemented as:
class A
{
public void show()
{
Console.WriteLine("Hello: Base Class!");
Console.ReadLine();
}
}
class B : A
{
public new void show()
{
Console.WriteLine("Hello: Derived Class!");
Console.ReadLine();
}
}
Subhashkumar YadavPosted Feb 22, 2017, 2:16 AM EST

