January 2011
Intermediate to advanced
1648 pages
70h 30m
English
As previously mentioned, the sealed keyword prevents a class from being derived any further. We can also apply such specialization prevention at a more granular level of members, too. For example, while we may leave our Square type unsealed (the default), we can prevent people from overriding the virtual properties we’ve defined:

Now if someone comes in and defines a subclass of Square, say ColoredSquare, it’s no longer possible to override the computation properties Area or Circumference.
With regard to hiding using the new modifier, it’s possible to hide an inherited member, including virtual ones, but the combination ...
Read now
Unlock full access