What type of class cannot be inherited? Why and how this can be done? Kindly explain with examples.
Also What are the possible ways to prevent a class from being derived?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Class that are marked with the
sealed(C#) orNotInheritable(VB.NET) keywords cannot be inherited from. This is done at the definition of the classes. The most commonly used sealed class is System.String.