Sealed classes are used to restrict the inheritance feature of object oriented programming. Once a class is defined as sealed class, this class cannot be inherited.

 

In C#, the sealed modifier is used to define a class as sealed. In Visual Basic .NET, NotInheritable keyword serves the purpose of sealed. If a class is derived from a sealed class, compiler throws an error.

 

If you have ever noticed, structs are sealed. You cannot derive a class from a struct. 

 

http://www.c-sharpcorner.com/UploadFile/mahesh/SealedClasses11142005063733AM/SealedClasses.aspx

相关文章:

  • 2022-02-12
  • 2021-07-11
  • 2022-12-23
  • 2022-12-23
  • 2021-09-18
  • 2021-09-05
  • 2021-08-25
  • 2022-02-20
猜你喜欢
  • 2021-11-10
  • 2021-08-07
  • 2022-01-30
  • 2021-10-30
  • 2021-10-07
  • 2022-12-23
  • 2021-11-18
相关资源
相似解决方案