1. void类型,例如:
public override void DoWork(int i)
{
// New implementation.
}
2. string类型
public override string ToString()
{
string s = age.ToString();
return "Person: " + name + " " + s;
}
3. double类型
public override double Area()
{
return (2 * base.Area()) + (2 * pi * x * y);
}
4. int 类型
public override int TestProperty
{
// Use the same accessibility level as in the overridden accessor.
protected set { }
// Cannot use access modifier here.
get { return 0; }
}
|