hey this code doesn't work i know it something to do with th way i create a copy of another rectangle passed in as an argument ON LINE 36~.. what am i missing? thanks!
package com.codegym.task.task05.task0520;
/*
Create a Rectangle class
*/
public class Rectangle {
//write your code here
int top;
int left;
int width;
int height;
public Rectangle(int top){
this.top = top;
this.left = 01;
}
public Rectangle(int top, int left){
this.top = top;
this.left = left;
this.width = 0;
}
public Rectangle(int top, int left, int width){
this.top = top;
this.left = left;
this.width = width;
this.height = width;
}
public Rectangle(anotherObj top, anotherObj left){
this.top = top;
this.left = left;
}
public static void main(String[] args) {
Rectangle num1 = new Rectangle(2);
Rectangle num2 = new Rectangle(3,5);
Rectangle num3 = new Rectangle(num2.top,num2.left);
System.out.println(num3.top, num3.left);
}
}