day12_Rectangle

육희영·2021년 10월 27일
0
package com.java1.day12;

public class Rectangle {
	private int x, y;
	private int width, height;

	Rectangle() {
		this(0, 0, 1, 1);
	}

	Rectangle(int width, int height) {
		this(0, 0, width, height);
	}

	Rectangle(int x, int y, int width, int height) {
		this.x = x;
		this.y = y;
		this.width = width;
		this.height = height;

	}

	public static void main(String[] args) {
		new Rectangle(1, 2);
		new Rectangle(100, 200);
		new Rectangle(1, 1, 100, 200);

	}
}

0개의 댓글

관련 채용 정보