Use new keyword when hiding base class's method in child class.
Different ways to call base class method Using Base KeyWord Can call base class's method in child class using base keyword. (base.ParentClassMethod) 2. Cast it to Parent type: ((BaseClass) ChildClassObject). BaseClassMethod() 3. Using Reference Type BaseClass Obj = New ChildClass childclassobj Obj.baseClassMethodname() Note: ChildClasschildclassObj =New BaseClass Obj (Compilation Error) #OopsConcept #Oops #OopsTutorialsDot Net Office
Oops Tutorials in C#
Part 5 - Method Hiding in C# | Oops Tutorials in C# | Oops Concept
Next
« Prev Post
« Prev Post
Previous
Next Post »
Next Post »
Subscribe to:
Post Comments (Atom)
EmoticonEmoticon