Support us .Net Basics C# SQL ASP.NET ADO.NET MVC Slides C# Programs Subscribe Buy DVD

Part 22 - C# Tutorial - Method hiding in C#


Part 22 - C# Tutorial - Method hiding


2 comments:

  1. Hello Venkat
    What is a use of method Hiding?

    ReplyDelete
  2. 1) Use new keyword when hiding base class's method in child class.
    2) Can call base class's method in child class using base keyword. (base.ParentClassMethod)
    Or
    Cast it to Parent type:
    ((BaseClass) ChildClassObject). BaseClassMethod
    Or
    BaseClass baseClassObj = New ChildClass childclassobj
    baseClassObj.baseClassMethodname

    Note: ChildClass childclassObj =New BaseClass Obj (WRONG!!!)

    ReplyDelete

If you like this website, please share with your friends on facebook and Google+ and recommend us on google using the g+1 button on the top right hand corner.