I can't intialize the last three variables (left, width or height) with an intialize method?!
package com.codegym.task.task05.task0513;
/*
Let's put together a rectangle
The program must not read data from the keyboard.
*/
public class Rectangle {
//write your code here
private int top, left, width, height;
// if height equals width then these are always squares, therefore they can all be equal!
public void initialize(int top) { this.top = top; } //this.left = top; this.width = top; this.height = top; }
public void initialize(int leff) { this.left = leff; } //this.left = left; this.width = left; this.height = left; }
//public void initialize(int width) { this.top = width; } //this.left = width; this.width = width; this.height = width; }
//public void initialize(int height) { this.top = height; this.left = height; this.width = height; this.height = height; }
public void initialize(Rectangle copy) {
this.top = copy.top;
this.left = copy.left;
this.height = copy.height;
this.width = copy.width;
}
public static void main(String[] args) {
}
}