The constructor of the derived class implicitly calls the constructor for the base class, or the superclass in Java terminology. In inheritance, all base class constructors are called before the derived class's constructors in the order that the classes appear in the class hierarchy.
Now, if the base class has more than one constructor, then the derived class has to define which one should be called. For example:
public class CoOrds
{
private int x, y;
public CoOrds()
{
x = 0;
y = 0;
}
public CoOrds(int x, int y)
{
this.x = x;
this.y = y;
}
}
//inherits CoOrds:
public class ColorCoOrds : CoOrds
{
public System.Drawing.Color color;
public ColorCoOrds() : base ()
{
color = System.Drawing.Color.Red;
}
public ColorCoOrds(int x, int y) : base (x, y)
{
color = System.Drawing.Color.Red;
}
}
For more information please visit: http://msdn.microsoft.com/en-us/library/ms228387(v=vs.80).aspx