基類和派生類
Rectangle rect =new Rectangle();
rect.SetWidth(5);
rect.SetHeight(7);
Report.Info("矩形面積:"+rect.getArea());
class shape{
public void SetWidth(int W){
Width=W;
}
public void SetHeight(int H){
Height=H;
}
protected int Width;
protected int Height;
}
class Rectangle:shape{
public int getArea(){
return (Width*Height);
}
}