I do not understand what is expected of me to do.I cant paint a picture in my head to even think of a solution.
How many constructor am i suppose to create? Am i supposed to create a copy constructor and pass Rectangle as an argument?
I do not understand what it means that the class must have at least one constructor, at least two constructor,at least three constructor.
I also do not understand these conditions
- width/height is not specified (both are 0)
- height is not specified (it is equal to the width), we'll create a square
I need help
package com.codegym.task.task05.task0520;
/*
Create a Rectangle class
*/
public class Rectangle {
//write your code here
int top,left,width,height;
public Rectangle(int top,int left,int width,int height){
this.top=top;
this.left=left;
this.width=width;
this.height=height;
height = 0;
weight= height;
}
Rectangle (Rectangle copyConstructor){
top=cop.top;
left=cop.left;
width = cop.width;
height=cop.height;
}
/*public Rectangle(int top,int left,int width,int height){
this.top=top;
this.left=left;
this.width=width;
this.height=height;
}*/
/* public Rectangle(int top,int left,int width,int height){
this.top=top;
this.left=left;
this.width=width;
this.height=height;
}*/
/*public Rectangle(int top,int left,int width,int height){
this.top=top;
this.left=left;
this.width=width;
this.height=height;
}
*/
public static void main(String[] args) {
}
}