Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/main/java/core/basesyntax/AbstractFigure.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package core.basesyntax;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is an empty line after the package declaration. This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line so the class declaration follows the package statement directly.

public abstract class AbstractFigure implements AreaMeasurable, Drawable {
protected String color;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is an empty line inside the class before the constructor. This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line to keep class internals compact.

public AbstractFigure(String color) {
this.color = color;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is an empty line inside the class after the constructor. This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line to keep class internals compact.

public String getColor() {
return color;
}
}
6 changes: 6 additions & 0 deletions src/main/java/core/basesyntax/AreaMeasurable.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package core.basesyntax;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" — remove the blank line between the package declaration and the interface declaration so the file starts immediately after the package line.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line immediately after the package declaration. This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove the blank line so the interface starts directly after the package statement.

public interface AreaMeasurable {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public interface AreaMeasurable {
public interface AreaCalculator {

double getArea();
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" — remove the redundant empty/trailing blank line at the end of the file to avoid extra empty lines.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an unnecessary empty line near the end of the file before the final non-commentable marker. Remove this redundant empty line to comply with the checklist instruction: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)"

22 changes: 22 additions & 0 deletions src/main/java/core/basesyntax/Circle.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package core.basesyntax;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is a redundant empty line at the start of the file. It violates the checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove unnecessary leading blank lines so the class starts immediately after the package declaration .

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is an empty line between the package declaration and the class declaration. It violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove this blank line so the class declaration immediately follows the package statement.

public class Circle extends AbstractFigure {
private final double radius;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This blank line before the constructor is redundant. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this empty line so members are grouped without extra leading blank lines .

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line right before the constructor. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line so the constructor starts directly after the field declaration.

public Circle(String color, double radius) {
super(color);
this.radius = radius;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This blank line before the @OverRide is redundant. Per checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this empty line so the method annotation and signature start directly after the previous member .

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line immediately before the getArea() method. Per the checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line so method implementations do not start with an empty line.

@Override
public double getArea() {
return Math.PI * radius * radius;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This blank line before the @OverRide for draw() is redundant. The checklist says: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this empty line to comply with the style requirement .

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line immediately before the draw() method. The checklist says: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line so the draw() method starts without a preceding empty line.

@Override
public void draw() {
System.out.println("Figure: circle, area: " + getArea()
+ " aq. units, radius: " + radius

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line contains the area units text: "aq. units" which is incorrect. The task examples require the printed area unit to be "sq. units" (e.g., "Figure: square, area: 25.0 sq. units, side: 5 units, color: blue"). Please change "aq. units" to "sq. units" so the output matches the required example and uses correct English wording .

+ " units, color: " + getColor());
Comment on lines +18 to +20

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The draw() output contains a typo in the area units: it prints "aq. units". The task requires the printed info to include the area with units as shown (example: "area: 25.0 sq. units"). Please change "aq. units" to "sq. units" to match the required output format. See the description/examples for required formatting.

}
}
13 changes: 13 additions & 0 deletions src/main/java/core/basesyntax/ColorSupplier.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package core.basesyntax;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This blank line at the top of the file should be removed. Checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove leading empty lines so the class begins immediately after the package declaration.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this empty line. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" The package declaration should be directly followed by imports (no blank line).

import java.util.Random;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This blank line is redundant and should be removed. Checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Keep the imports and class declaration without extra empty lines between them.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this empty line. The import should be directly above the class declaration without an intervening blank line; the checklist asks to avoid redundant empty lines at class/method starts.

public class ColorSupplier {
private static final String[] COLORS = {"red", "blue", "green", "yellow", "black"};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create enum for Colors


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This blank line before the class body is redundant. Checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove it so fields and methods are grouped without unnecessary spacing.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this empty line between the COLORS constant and the method. The checklist: "Don't begin class or method implementation with an empty line." Keep fields and methods without unnecessary blank lines.

public String getRandomColor() {
Random random = new Random();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This creates a new Random on every call. Consider using a class-level Random instance instead and reusing it to avoid repeated allocations and to follow the checklist guidance: "Think about which variables should be local in the method and which should be class-level" . Example approach: add private final Random random = new Random(); as a field and use it inside getRandomColor() rather than new Random() here.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You create a new Random instance inside the method: Random random = new Random();. This violates the checklist guidance: "Think about which variables should be local in the method and which should be class-level". Move Random to a class-level field (e.g., private final Random random = new Random();) and reuse it in getRandomColor() to avoid re-creating Random on each call.

int index = random.nextInt(COLORS.length);
return COLORS[index];
Comment on lines +9 to +11

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently a new Random() is created inside the method on every call. This violates the checklist guidance to reuse a class-level Random instance. Please add a class-level field, e.g., private final Random random = new Random(); and replace the local Random random = new Random(); with usage of that field. This is both more efficient and matches the style guidance.

}
}
5 changes: 5 additions & 0 deletions src/main/java/core/basesyntax/Drawable.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package core.basesyntax;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This blank line after the package declaration should be removed. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the empty line so the interface declaration follows the package statement directly.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line between the package declaration and the interface declaration. This violates the checklist rule: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line so the interface starts immediately after the package statement.

public interface Drawable {
void draw();
}
36 changes: 36 additions & 0 deletions src/main/java/core/basesyntax/FigureSupplier.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package core.basesyntax;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a redundant leading empty line. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove unnecessary blank lines so the class starts immediately after the package declaration .

import java.util.Random;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a redundant empty line before the import. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this empty line to comply with the style requirement .

public class FigureSupplier {
private static final int FIGURE_COUNT = 5;
private static final int MAX_SIZE = 10;
private final Random random = new Random();
Comment on lines +6 to +8

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Positive: class-level Random and constants FIGURE_COUNT and MAX_SIZE are used, and the switch has a default branch returning getDefaultFigure(), so methods won't return null. This follows checklist suggestions about deterministic bounds and not returning null. Keep these patterns.

private final ColorSupplier colorSupplier = new ColorSupplier();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a redundant empty line inside the class. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove unnecessary blank lines so members are grouped without extra leading lines .

// Змінено тип повернення на AbstractFigure

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline Ukrainian comment. The checklist says: "Use only eng in messages/code: Try not to use ukr/ru messages in toString() or System.out.println() statements." Replace this comment with English or remove it .

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comment

public AbstractFigure getRandomFigure() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method signatures use AbstractFigure as the return type (public AbstractFigure getRandomFigure() and public AbstractFigure getDefaultFigure()). The task description expects: "FigureSupplier with the public Figure getRandomFigure() method - for generating figures with random properties." Consider returning the interface/abstraction required by the task (e.g., Figure or a top-level interface) instead of AbstractFigure to match the description and reduce coupling.

int figureType = random.nextInt(FIGURE_COUNT);
String color = colorSupplier.getRandomColor();

return switch (figureType) {
case 0 -> new Square(color, random.nextInt(MAX_SIZE) + 1);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line passes a random expression directly into the Square constructor: new Square(color, random.nextInt(MAX_SIZE) + 1). The checklist explicitly requires: "Creating a figure, don't pass expressions in the constructor. Create separate variables and pass them on for better code readability." Generate the random value into a local variable first (e.g., int side = random.nextInt(MAX_SIZE) + 1;) and then call the constructor with that variable .

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The switch branches pass expressions directly into constructors, for example: new Square(color, random.nextInt(MAX_SIZE) + 1). This violates the checklist item: "Creating a figure, don't pass expressions in the constructor. Create separate variables and pass them on for better code readability." Please generate local variables for the random dimensions first (e.g., int side = random.nextInt(MAX_SIZE) + 1;) and pass those to the constructors to improve readability and follow the checklist.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create separate method for getting random side random.nextInt(MAX_SIZE) + 1

case 1 -> new Rectangle(color,
random.nextInt(MAX_SIZE) + 1, random.nextInt(MAX_SIZE) + 1);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line passes expressions directly into the Rectangle constructor: random.nextInt(MAX_SIZE) + 1, random.nextInt(MAX_SIZE) + 1. The checklist requires: "Creating a figure, don't pass expressions in the constructor. Create separate variables and pass them on for better code readability." Create local variables for width and height before calling the constructor .

Comment on lines +18 to +19

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue for Rectangle: inline expressions are used for both width and height. This violates the checklist item: "Creating a figure, don't pass expressions in the constructor. Create separate variables and pass them on for better code readability." Assign width and height to local variables before constructing the Rectangle.

case 2 -> new RightTriangle(color,
random.nextInt(MAX_SIZE) + 1, random.nextInt(MAX_SIZE) + 1);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line passes expressions directly into the RightTriangle constructor: random.nextInt(MAX_SIZE) + 1, random.nextInt(MAX_SIZE) + 1. The checklist requires generating values into local variables first. Do that to improve readability and comply with the rule: "Creating a figure, don't pass expressions in the constructor..." .

Comment on lines +20 to +21

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue for RightTriangle: inline expressions are passed into the constructor. This violates the checklist item: "Creating a figure, don't pass expressions in the constructor. Create separate variables and pass them on for better code readability." Compute firstLeg and secondLeg as local variables first.

case 3 -> new Circle(color, random.nextInt(MAX_SIZE) + 1);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line passes an expression into the Circle constructor: new Circle(color, random.nextInt(MAX_SIZE) + 1). Per the checklist: "Creating a figure, don't pass expressions in the constructor. Create separate variables and pass them on for better code readability." Assign the radius to a local variable before calling the constructor .

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue for Circle in the switch: new Circle(color, random.nextInt(MAX_SIZE) + 1). This violates the checklist guidance: "Creating a figure, don't pass expressions in the constructor. Create separate variables and pass them on for better code readability." Create a local radius variable first and pass it into the constructor.

case 4 -> new IsoscelesTrapezoid(color,
random.nextInt(MAX_SIZE) + 1,
random.nextInt(MAX_SIZE) + 1,
random.nextInt(MAX_SIZE) + 1);
Comment on lines +23 to +26

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The IsoscelesTrapezoid construction uses three inline expressions (random.nextInt(MAX_SIZE) + 1 repeated). The checklist: "Creating a figure, don't pass expressions in the constructor. Create separate variables and pass them on for better code readability." Introduce local variables for base1, base2, height and pass them to the constructor (this improves readability and maintainability) .

Comment on lines +23 to +26

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue for IsoscelesTrapezoid: three inline expressions are passed into the constructor. This violates: "Creating a figure, don't pass expressions in the constructor. Create separate variables and pass them on for better code readability." Assign base1, base2, and height to locals and pass them to the constructor.

default -> getDefaultFigure();
};
}

// і тут теж

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This inline Ukrainian comment should be replaced with English. The checklist: "Use only eng in messages/code: Try not to use ukr/ru messages in toString() or System.out.println() statements." Replace or remove to comply with the requirement .

Comment on lines +11 to +31

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are in-file comments written in Ukrainian (e.g., // Змінено тип повернення на AbstractFigure, // і тут теж). The checklist instructs: "Use only eng in messages/code: Try not to use ukr/ru messages in toString() or System.out.println() statements." Replace these comments with English text to comply with the guideline.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comment

public AbstractFigure getDefaultFigure() {
return new Circle("white", 10);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line returns a default figure created with raw literals: new Circle("white", 10). The checklist requires: "All magic numbers in your code should be constants." Also, the task description specifies the default figure: a white circle with radius 10 — keep these values but extract them as constants (e.g., DEFAULT_COLOR and DEFAULT_RADIUS) and use them here for clarity and compliance .

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getDefaultFigure() returns new Circle("white", 10) using literals directly. This violates the checklist item: "All magic numbers in your code should be constants." Please define and use constants like private static final String DEFAULT_COLOR = "white"; and private static final int DEFAULT_RADIUS = 10; (or appropriately-typed constants) and return new Circle(DEFAULT_COLOR, DEFAULT_RADIUS).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10 is magic number, create constant

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use WHITE from enum

}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This trailing empty line after the class should be removed. The checklist requires removal of redundant empty lines: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Clean trailing blank lines to match the style guide .

17 changes: 17 additions & 0 deletions src/main/java/core/basesyntax/HelloWorld.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@
/**
* Feel free to remove this class and create your own.
*/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are redundant empty lines inside the file (leading/trailing blank lines before the class/method bodies). This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)". Remove the blank lines so the class and method start immediately. Notable commentable empty lines: 6, 12, 16, 20, 26.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a redundant empty line before the class declaration. Checklist violation: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the extra blank line so the class starts immediately after the package/comment block.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is an empty line before the class declaration. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove this blank line so the class declaration immediately follows the package/comment block.

public class HelloWorld {
public static void main(String[] args) {
FigureSupplier figureSupplier = new FigureSupplier();
AbstractFigure[] figures = new AbstractFigure[6]; // тут AbstractFigure

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line uses a magic number for the array size and contains a non-English comment. Checklist violations:

  • "All magic numbers in your code should be constants." — extract the literal 6 into a named constant (e.g., FIGURES_ARRAY_SIZE) and use that constant here.
  • "Use only eng in messages/code: Try not to use ukr/ru messages in toString() or System.out.println() statements." — replace the Ukrainian comment with English or remove it.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Array size is hard-coded here: AbstractFigure[] figures = new AbstractFigure[6];. The checklist requires: "All magic numbers in your code should be constants." Replace the literal 6 with a named constant (for example FIGURES_ARRAY_SIZE) and use that constant when allocating the array.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 is a magic number, create constant


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant empty line inside the class/method. Checklist violation: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove unnecessary blank lines inside main to comply with the style requirement.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty line between variable setup and the loop. The checklist says: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the redundant blank line to comply with the style guidance.

for (int i = 0; i < figures.length / 2; i++) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use one for loop to implement main method

figures[i] = figureSupplier.getRandomFigure();
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty line before the second loop — remove it. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)"

for (int i = figures.length / 2; i < figures.length; i++) {
figures[i] = figureSupplier.getDefaultFigure();
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant empty line before the final for-each loop. Checklist violation: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this extra blank line to tidy up the method body.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty line before the final loop — remove it. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)"

for (AbstractFigure figure : figures) {
figure.draw(); // draw() є в AbstractFigure через Drawable

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This inline comment is written in Ukrainian. Checklist violation: "Use only eng in messages/code: Try not to use ukr/ru messages in toString() or System.out.println() statements." Replace the comment with English text (for example: "// draw() is defined in AbstractFigure via Drawable") or remove it.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inline comment here is in Ukrainian: // draw() є в AbstractFigure через Drawable. The checklist instructs: "Use only eng in messages/code: Try not to use ukr/ru messages in toString() or System.out.println() statements." Please replace this with an English comment (e.g., // draw() is declared in AbstractFigure via Drawable) or remove it.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comment

}
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing redundant empty line after the class. Checklist violation: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove trailing blank lines at the file end to follow the style rule.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing empty line near the file end — remove it. The checklist requests: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Clean up these redundant blank lines.

28 changes: 28 additions & 0 deletions src/main/java/core/basesyntax/IsoscelesTrapezoid.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package core.basesyntax;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is an empty line immediately after the package declaration. It violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove this redundant blank line so the class declaration follows the package declaration directly.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line immediately after the package declaration. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line so the class declaration follows the package statement directly.

public class IsoscelesTrapezoid extends AbstractFigure {
private final double base1;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't use numbers for naming

private final double base2;
private final double height;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This empty line before the constructor is redundant. It violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove it so the constructor follows the field declarations without an extra leading blank line.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line immediately before the constructor. Per the checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line so the constructor starts directly after the field declarations.

public IsoscelesTrapezoid(String color, double base1, double base2, double height) {
super(color);
this.base1 = base1;
this.base2 = base2;
this.height = height;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This empty line before the getArea() method is redundant. It violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line so the @OverRide and method signature start directly after the previous member.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line immediately before the getArea() method. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line so method implementations don't start with an empty line.

@Override
public double getArea() {
return (base1 + base2) / 2 * height;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This empty line before the draw() method is redundant. It violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line so the @OverRide and draw() start immediately after the previous method.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line immediately before the draw() method. The checklist states: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line so the draw() method begins without a preceding empty line.

@Override
public void draw() {
System.out.println("Figure: isoscelesTrapezoid, area: " + getArea()
+ " sq. units, base1: " + base1
+ " units, base2: " + base2
+ " units, height: " + height
+ " units, color: " + getColor());
}
}
25 changes: 25 additions & 0 deletions src/main/java/core/basesyntax/Rectangle.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package core.basesyntax;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a redundant empty line at the top of the file. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line so the class declaration follows directly after the package declaration.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is a redundant empty line before the class declaration. It violates the checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line so the class declaration immediately follows the package statement.

public class Rectangle extends AbstractFigure {
private final double width;
private final double height;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This empty line before the constructor is redundant. The checklist requires removing leading empty lines before methods/constructors. Remove this blank line so the constructor follows the field declarations without an extra empty line.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is a redundant empty line between field declarations and the constructor. It violates the checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line so the constructor starts immediately after the fields.

public Rectangle(String color, double width, double height) {
super(color);
this.width = width;
this.height = height;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This empty line before the @OverRide of getArea() is redundant. Per the checklist: "Don't begin class or method implementation with an empty line." Remove this blank line so the annotation and method start immediately after the constructor.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is a redundant empty line just before the getArea() method. It violates the checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line so the method implementation doesn't begin with an empty line.

@Override
public double getArea() {
Comment on lines +13 to +14

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The task/checklist recommends separating conceptually different behaviors into different interfaces: "Don't put all behavior into a single interface if the methods are conceptually different from each other." Consider introducing two small interfaces (e.g., AreaProvider with double getArea() and Drawable with void draw()) and make Rectangle implement them. This will satisfy the requirement to separate concerns and avoids relying on an abstract class solely for behavior.

return width * height;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This empty line before the @OverRide of draw() is redundant. The checklist requires removal of such leading empty lines; please remove it so the annotation and method signature follow the previous method without an extra blank line.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is a redundant empty line just before the draw() method. It violates the checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line so the draw() method starts directly after the previous method.

@Override
public void draw() {
System.out.println("Figure: rectangle, area: " + getArea()
+ " sq. units, width: " + width
+ " units, height: " + height
+ " units, color: " + getColor());
}
}
25 changes: 25 additions & 0 deletions src/main/java/core/basesyntax/RightTriangle.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package core.basesyntax;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line immediately after the package declaration. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove this redundant blank line (line 2).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant empty line at the top of the file. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line so the class declaration follows immediately after the package line .

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file begins with an empty line before the class declaration. This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line so the class declaration follows the package line directly.

public class RightTriangle extends AbstractFigure {
private final double firstLeg;
private final double secondLeg;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line before the constructor (line 6). The checklist requires removing redundant empty lines: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove this blank line to comply with style rules.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant empty line before the constructor. Per checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line so the constructor begins immediately after the field declarations .

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line immediately before the constructor. This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line so the constructor starts directly after the field declarations.

public RightTriangle(String color, double firstLeg, double secondLeg) {
super(color);
this.firstLeg = firstLeg;
this.secondLeg = secondLeg;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line before the @Override of getArea() (line 12). Remove this redundant empty line as requested by the checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant empty line before the getArea() override. The checklist requires removal of redundant empty lines: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line so the method annotation and signature start directly after the previous member .

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line immediately before the getArea() method. This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line so the getArea() method starts immediately after the constructor.

@Override
public double getArea() {
return (firstLeg * secondLeg) / 2;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line before the @Override of draw() (line 17). Remove this redundant blank line to satisfy the checklist style rule: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant empty line before the draw() override. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line so the @OverRide and method signature are contiguous with previous declarations .

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an empty line immediately before the draw() method. This violates the checklist item: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line so the draw() method starts without a preceding empty line.

@Override
public void draw() {
System.out.println("Figure: rightTriangle, area: " + getArea()
+ " sq. units, firstLeg: " + firstLeg
+ " units, secondLeg: " + secondLeg
+ " units, color: " + getColor());
}
}
22 changes: 22 additions & 0 deletions src/main/java/core/basesyntax/Square.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package core.basesyntax;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are redundant empty lines at several places in this file (for example line 2, line 5, line 10, line 15, line 22). The checklist requires removing such empty lines: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove unnecessary blank lines to comply with the style rule .

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a redundant empty line. It violates the checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the extra blank line so the class declaration starts directly after the package declaration.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is an empty line immediately after the package declaration. This violates the checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Please remove this blank line so the class declaration follows the package statement directly.

public class Square extends AbstractFigure {
private final double side;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This empty line before the constructor is redundant. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove this blank line so members begin without an extra empty line.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is an empty line before the constructor. This violates the checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line so the constructor starts directly after the field declaration.

public Square(String color, double side) {
super(color);
this.side = side;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This empty line before the @OverRide of getArea() is redundant. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove it to comply with the style rule.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is an empty line before the getArea() method. This violates the checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line so method implementations do not start with an empty line.

@Override
public double getArea() {
return side * side;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This empty line before the @OverRide of draw() is redundant. The checklist requires: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove it so methods start immediately after previous members.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is an empty line before the draw() method. This violates the checklist: "Don't begin class or method implementation with an empty line. Remove all redundant empty lines, be careful :)" Remove the blank line so the draw() method starts without a preceding empty line.

@Override
public void draw() {
System.out.println("Figure: square, area: " + getArea()
+ " sq. units, side: " + side
+ " units, color: " + getColor());
}
}