9
Reply

How to hide the base class functionality in Inheritance?

Abhishek Tyagi

Abhishek Tyagi

Oct 11, 2012
3.5k
0

    We can use new operator to hide the base class functionality.

    Rahul Prajapat
    June 03, 2015
    0

    We can use new operator to hide the base class functionality......

    using virtual method in base class and override in child class.And also using new class without declaring virtual and override

    Bhabani Prasad
    May 24, 2014
    0

    using virtual method in base class and override in child class.And also using new class without declaring virtual and override

    Bhabani Prasad
    May 24, 2014
    0

    If you are using sealed method then it is not going to be overridden in derived class, but you want to hide then you have to use 'new' in base class.You can use 'New' keyword with data as well as with method of the class to hide it in inheritance.

    sumank
    May 10, 2013
    0

    Hi! if u want to hide base class functionality,use "New" keyword instead of Sealed.Because,Sealed classes are used to restrict the inheritance feature of object oriented programming. Once a class is defined as sealed class, this class cannot be inherited.One of the best usage of sealed classes is when you have a class with static members. For example, the Pens and Brushes classes of the System.Drawing namespace.

    shravan kumar
    April 30, 2013
    0

    using new keyword

    masthan p
    December 02, 2012
    0

    if we declare those functionality which we dont want to inherited in child class then we have to use sealed keyword.

    suresh kumar behera
    October 26, 2012
    0

    you can hide the base class functionality by using the new keyword

    balaji R
    October 12, 2012
    0