C# (Sharp) Programming Language Question:
Download Questions PDF

Can you prevent your class from being inherited and becoming a base class for some other classes?

Answer:

Yes, that is 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 is the same concept as final class in Java.

Download C# (Sharp) Programming Language Interview Questions And Answers PDF

Previous QuestionNext Question
Is there an equivalent of exit() for quitting a C# .NET application?If a base class has a bunch of overloaded constructors ...