diff --git a/src/main/java/core/basesyntax/AreaCalculator.java b/src/main/java/core/basesyntax/AreaCalculator.java index ff574f272e..2d23db4bc1 100644 --- a/src/main/java/core/basesyntax/AreaCalculator.java +++ b/src/main/java/core/basesyntax/AreaCalculator.java @@ -1,5 +1,5 @@ package core.basesyntax; public interface AreaCalculator { - public abstract double calculateArea(); + double calculateArea(); } diff --git a/src/main/java/core/basesyntax/Drawable.java b/src/main/java/core/basesyntax/Drawable.java index 92215076fb..d045270178 100644 --- a/src/main/java/core/basesyntax/Drawable.java +++ b/src/main/java/core/basesyntax/Drawable.java @@ -1,5 +1,5 @@ package core.basesyntax; public interface Drawable { - public abstract void draw(); + void draw(); } diff --git a/src/main/java/core/basesyntax/FigureSupplier.java b/src/main/java/core/basesyntax/FigureSupplier.java index 3515f59bd7..f542f520d4 100644 --- a/src/main/java/core/basesyntax/FigureSupplier.java +++ b/src/main/java/core/basesyntax/FigureSupplier.java @@ -5,10 +5,10 @@ public class FigureSupplier { private static final int FIGURE_TYPE_BOUND = 5; private final Random random = new Random(); - private final String randomColor = new ColorSupplier().getRandomColor(); - private final int randomFigure = random.nextInt(FIGURE_TYPE_BOUND); public Figure getRandomFigure() { + String randomColor = new ColorSupplier().getRandomColor(); + int randomFigure = random.nextInt(FIGURE_TYPE_BOUND); switch (randomFigure) { case 0: return new Square(randomColor, random.nextInt(10)); diff --git a/src/main/java/core/basesyntax/Main.java b/src/main/java/core/basesyntax/Main.java index dae9917a78..bbb48b9898 100644 --- a/src/main/java/core/basesyntax/Main.java +++ b/src/main/java/core/basesyntax/Main.java @@ -5,7 +5,7 @@ public static void main(String[] args) { Figure[] figureArray = new Figure[6]; FigureSupplier figureSupplier = new FigureSupplier(); for (int i = 0; i < figureArray.length; i++) { - if (i < 3) { + if (i < figureArray.length/2) { figureArray[i] = figureSupplier.getRandomFigure(); } else { figureArray[i] = figureSupplier.getDefaultFigure();