What does the sealed modifier do when applied to a C# class?
Correct answer A. It prevents other classes from inheriting from it
Explanation
A sealed class cannot be used as a base class, so class Derived : MySealedClass is a compile error. System.String is a well-known example. sealed can also be applied to an override to stop further overriding in later derived classes. It does not stop instantiation, which is what abstract or a static class does, and visibility is controlled by access modifiers.
Answer checked How we write and check questions
Discussion