is it possible to inherit a class but methods declared in
the class should not be inheritable i possible how?

Answer Posted / aakanchha

Yes..!!
We can define a method as "private" ,so the method will not
be inherited.

and by 'sealed' we can prevent overriding but can not
prevent inheriting .

Is This Answer Correct ?    17 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why we use dll in c#?

547


What is session variable in c#?

561


Why objects are stored in heap in c#?

480


Can you access a hidden base class method in the derived class?

498


how to Create a datagridview control with check box column with 8rows in it, the maximum number of check boxes checked should be 3, when user checks the 4th corresponding message should be displayed and check box should be checked. User can uncheck the checked boxes Note: read-only property should not be used

2397






What is an xsd file?

507


What is extended class in c#?

474


What is the difference between do and while loop?

448


What is the advantage of generics in c#?

505


What is int32 maxvalue?

516


How big is an int in c#?

512


What are the different approaches of passing parameters to a method?

482


How many constructor can a class have?

473


What is assembly c#?

477


How do you mark a method obsolete?

580