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

What is a method signature c#?

691


What are the types of delegates in c#?

634


I was trying to use an out int parameter in one of my functions. How should I declare the variable that I am passing to it?

738


Write a C# program to find the Factorial of n

736


What is difference between private, protected, and public in C#?

764


Explain the difference between the system.array.copyto() and system.array.clone()?

688


Can we inherit private members of class in c#?

732


What is concrete class in c# with example?

654


C# called c sharp why?

750


What is the difference between == and object.equals?

668


Can constructor be protected?

639


Define an assembly in .net?

725


What is response redirect in c#?

659


What is the difference between static class and abstract class in c#?

660


hi my question is about understanding a text the user entered to a site , so i want to analyse that text looking for some specific items such as "honda" "shoffere" etc.. so if this site could help or could tell me where to go with such question ,i wonder. thanks

1793