Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

using System;

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);
}

public rectangle(int x, int y, int width, int height)


{
this.x = x;
this.y = y;
this.width = width;
this.height = height;
Console.Write("Con 3:"+x);
Console.Write(y);
Console.Write(width);
Console.WriteLine(height);
}
}}

You might also like