Can you prevent your class from being inherited and becoming
a base class for some other classes?
Answer Posted / 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 |
Post New Answer View All Answers
How to put assembly in gac?
What does it mean to override a method?
How do you specify a custom attribute for the entire assembly (rather than for a class)?
Is c# good for beginners?
Explain the types of comments in c#?
What is the max value of int32 in c#?
Why do I get a "cs5001: does not have an entry point defined" error when compiling?
What does int32 mean?
In .NET how can you solve the DLL Hell problem?
Can I call a virtual method from a constructor/destructor?
What is an arraylist in c#?
What is called method in c#?
What is a static field?
What is a static class in c#?
When should I throw an exception?