Can you prevent your class from being inherited and becoming
a base class for some other classes?
Answers were Sorted based on User's Feedback
Answer / umesh
Yes, that?s what keyword sealed in the class definition is
for. The developer trying to derive from your class will get
a message: cannot inherit from Sealed class
WhateverBaseClassName. It?s the same concept as final class
in Java.
Is This Answer Correct ? | 12 Yes | 2 No |
Answer / neerajtyagi
You can prevent your class being derived using sealed
keyword.
But you can't use that class as base class once you make
that sealed.
Sealed and Derived both are opposite.
Is This Answer Correct ? | 8 Yes | 0 No |
What is Web.config?
Explain the difference between a namespace and assembly name in .net?
what is the difference between convert.tostring() and tostring() functions ?
What is dll hell, and how does .net solve it?
What is a proxy of the server object in .NET Remoting?
What are constructors in c#?
What are the boolean data types in c#?
What is a string? What are the properties of a string class?
Explain About Postback
Why is it a bad idea to throw your own exceptions?
What is master page in asp net c#?
Does c# do array bounds checking?