Interviews9 answers
How to hide the base class functionality in Inheritance?
9 Answers
We can use new operator to hide the base class functionality.
Rahul PrajapatPosted Jun 3, 2015, 6:17 PM EDT
We can use new operator to hide the base class functionality......
Pankaj Kumar ChoudharyPosted Mar 25, 2015, 7:52 PM EDT
using virtual method in base class and override in child class.And also using new class without declaring virtual and override
Bhabani PrasadPosted May 24, 2014, 3:38 AM EDT
using virtual method in base class and override in child class.And also using new class without declaring virtual and override
Bhabani PrasadPosted May 24, 2014, 3:38 AM EDT
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.
sumankPosted May 10, 2013, 12:06 PM EDT
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 kumarPosted Apr 29, 2013, 10:33 PM EDT
using new keyword
masthan pPosted Dec 2, 2012, 12:45 AM EST
if we declare those functionality which we dont want to inherited in child class then we have to use sealed keyword.
suresh kumar beheraPosted Oct 25, 2012, 8:35 PM EDT
you can hide the base class functionality by using the new keyword
balaji RPosted Oct 12, 2012, 1:51 AM EDT


