Sure - that chains one constructor onto another. There are two forms - this
to chain onto another constructor in the same class, and base
to chain to another constructor in the base class. The body of the constructor you're chaining to executes, and then your constructor body executes. (Of course, the other constructor may chain onto another one first.)
If you don't specify anything, it automatically chains to a parameterless constructor in the base class. So:
public Foo(int x)
{
// Presumably use x here
}
is equivalent to
public Foo(int x) : base()
{
// Presumably use x here
}
Note that instance variable initializers are executed before the other constructor is called.
Surprisingly, the C# compiler doesn't detect if you end up with mutual recursion - so this code is valid, but will end up with a stack overflow:
public class Broken
{
public Broken() : this("Whoops")
{
}
public Broken(string error) : this()
{
}
}
(It does prevent you chaining onto the exact same constructor signature, however.)
For more details, see my article on constructor chaining.