Can you prevent a class from overriding?
Answers were Sorted based on User's Feedback
Answer / techy_unknown
Hi,
I think the question itself is illogical.
The term "overriding" is ONLY and ONLY associated with
methods/properties not to the class.
So, if the question is put a like, "How to prevent methods
not to be overriden?" then the answer is: "Make them non-
virtual."
And if the question is put a like, "How to prevent the
inheritance for a specific class?" then the answer
is, "Make the calss sealed."
I really hope that the reply makes sense here.
| Is This Answer Correct ? | 38 Yes | 1 No |
Answer / nazrul
we can use sealed keyword at the time of declartion of class
thorugh which it won't inherit and won't be overide.
| Is This Answer Correct ? | 4 Yes | 6 No |
WHAT IS THE DIFFERENCE BETWEEN STRING AND STRING BUILDER ?
Explain About remoting and web services. Difference between them
What is the difference between namespace and class in c#?
Difference between multi-level and multiple inheritance?
explain the three services model commonly know as a three-tier application.
How do you declare an arraylist?
Does c# support multilevel inheritance?
What is the difference between Object and class adapters?
How do you specify a custom attribute for the entire assembly (rather than for a class)?
Can an interface inherit an interface
What do you understand by an Implicit Variable?
What is the difference between Hash Table and Arrays?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)