Mega Code Archive

 
Categories / C# Book / 01 Language Basics
 

0141 Seal a member

We can stop overridding with seal keyword. class Shape{ public virtual int Area{ get{ return 0; } } } class Rectangle:Shape{ public int width; public int height; public sealed override int Area{ get{ return width * height; } } }