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 to use lock statement in c#?

576


Can you inherit from a sealed class?

573


What is verbatim string?

590


What is console read in c#?

559


What is Named parameter in C#?

632






What do you mean by delegates and explain different types of delegates?

596


Describe the types of comments in c#?

598


How do I trim a space in c#?

533


What is poco c#?

578


What is iqueryable and ienumerable in c#?

603


What is void in c#?

633


what is scope of a protected internal member variable of a c# class

625


Explain the Usage of web.config

663


What is orm in c#?

561


What are functions in c#?

576