盒子类:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ClassLibrary1
{
public class Case
{
private double length;
public double Length
{
get { return length; }
set { length = value; }
}
private double width;
public double Width
{
get { return width; }
set { width = value; }
}
private double height;
public double Height
{
get { return height; }
set { height = value; }
}
public double TotalArea()
{
return Height * Width * Length;
}
}
}
彩色盒子类继承盒子类:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ClassLibrary1
{
class ChromaticCase:Case
{
}
}