Some of the syntax of inheritance is closer to C++ than Java:
public class Figure
{
private int iX;
private int iY;
public Figure()
: this(0, 0) // 2
{
}
public Figure(int pX, int pY)
{
iX = pX; iY = pY;
}
...
public override string ToString()
{
return iX + ":" + iY;
}
}
public class Circle: Figure // 1
{
private int iRadius;
public Circle()
: this(0, 0, 0) // 2
{
}
public Circle(int pX, int pY, int pRadius)
: base(pX, pY) // 2, 3
{
iRadius = pRadius;
}
...
public override string ToString()
{
return base.ToString() + ":" + iRadius; // 3
}
}