Can you allow class to be inherited, but prevent the method
from being over-ridden?

Answers were Sorted based on User's Feedback



Can you allow class to be inherited, but prevent the method from being over-ridden?..

Answer / guest

make the method as sealed

Is This Answer Correct ?    18 Yes 2 No

Can you allow class to be inherited, but prevent the method from being over-ridden?..

Answer / sujai cn

By using NEW key word with implementation of method (which
is declared as virtual in base class) in the derived class

Is This Answer Correct ?    3 Yes 0 No

Can you allow class to be inherited, but prevent the method from being over-ridden?..

Answer / mr.f

This problem is very easy, You just declared the method
without virtual keyword. :d

Is This Answer Correct ?    5 Yes 5 No

Can you allow class to be inherited, but prevent the method from being over-ridden?..

Answer / nkm

Class can be MustInherit and method can be NotInheritable
(VB.NET Concept)

Is This Answer Correct ?    0 Yes 1 No

Can you allow class to be inherited, but prevent the method from being over-ridden?..

Answer / avijit

declare the method as protected

Is This Answer Correct ?    5 Yes 11 No

Post New Answer

More C Sharp Interview Questions

What's difference between constants and static readonly?

0 Answers   Wipro,


what are some characteristics of an array?

0 Answers  


Why static variables are used?

0 Answers  


What are actions in c#?

0 Answers  


What is a callback c#?

0 Answers  


How do I count the length of a string in c#?

0 Answers  


What is the difference between final finally and finalize in c#?

0 Answers  


what is a destructor?

0 Answers   Amazon,


Can we inherit two classes in c#?

0 Answers  


Why is dll used?

0 Answers  


Which is algorithm is used to Manage the Memory in .net ??

7 Answers   TCS,


What are the different types of literals in c#?

0 Answers  


Categories