Добрый день!
"Отсутствует объявление класса, интерфейса или enum-а."
Подскажите, пожалуйста, чего не хватает? Как-будто бы все есть... Наверное )
package com.javarush.task.jdk13.task05.task0520;
/*
Заполнить класс прямоугольник (Rectangle)
*/
public class Rectangle {
//напишите тут ваш код
public int left;
public int top;
public int width;
public int height;
public Rectangle(int left, int top, int width, int height) {
this.left = left;
this.top = top;
this.width = width;
this.height = height;
}
public Rectangle(int left, int top) {
this.left = left;
this.top = top;
this.width = 0;
this.height = 0;
}
public Rectangle(int left, int top, int width) {
this.left = left;
this.top = top;
this.width = width;
this.height = width;
}
public Rectangle(Rectangle rectangle) {
this.left = rectangle.left;
this.top = rectangle.top;
this.width = rectangle.width;
this.height = rectangle.height;
}
}
public static void main(String[] args) {
}
}