Preventing override of individual methods in C#
问题 I know that I can use the sealed in order to prevent other classes to inherit a certain class, but is it possible to allow inheritance but prevent overriding of some virtual methods? 回答1: Only virtual methods can be overridden. Just leave out virtual , and your method will not be overridable. 回答2: you can also use sealed modifier to prevent a derived class from further overriding the method. check this out: Sealed methods 回答3: Yes. The sealed keyword can also be used on methods, to indicate