No path is too difficult. No destination is too far !
Calling constructor inside constructor in C#
To call one C# constructor from another, before the body of the constructor, use either:
: base (parameters)
to call a constructor in the base class; or:
: this (parameters)
to call a constructor in this class.
The following examples illustrate how to call one constructor from another.
public class myPopUp
{
public myPopUp(int width, int height, myPopUp parentPopUp) : this (width, height)
{
this.ParentPopUp = parentPopUp;
}
}
| Print article | This entry was posted by Ashish Sehajpal on February 16, 2010 at 4:51 pm, and is filed under Development. Follow any responses to this post through RSS 2.0. Both comments and pings are currently closed. |
Comments are closed.