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;
      }
   }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.