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

Can namespace contain the private class?

0 Answers  


What is default access specifier for class in c#?

0 Answers  


Explain About Postback

0 Answers   BirlaSoft,


Is string a primitive data type in c#?

0 Answers  


What does readonly mean in c#?

0 Answers  






Why do we use classes?

0 Answers  


What is data set in c#?

0 Answers  


What is the difference between CreateObject() and GetObject()?

0 Answers   CGI,


How does insertion sort work?

0 Answers  


What is the max value of int32 in c#?

0 Answers  


What is ado net in c#?

0 Answers  


What?s a satellite assembly?

1 Answers  


Categories