Professional Documents
Culture Documents
Demo Code of Using This
Demo Code of Using This
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
rectangle r = new rectangle();
rectangle r1 = new rectangle(2, 3);
rectangle r2 = new rectangle(1, 4, 2, 3);
}
}
class rectangle
{
private int x, y, width, height;
public rectangle():this(0,0,0,0)
{
Console.Write("Con1: "+x);
Console.Write(y);
Console.Write(width);
Console.WriteLine(height);
}
public rectangle(int width, int height)
: this(0, 0, width, height)
{
Console.Write("Con 2: "+x);
Console.Write(y);
Console.Write(width);
Console.WriteLine(height);
}