diff --git a/src/main/java/core/basesyntax/Application.java b/src/main/java/core/basesyntax/Application.java index 922b568dd..5540f9d9e 100644 --- a/src/main/java/core/basesyntax/Application.java +++ b/src/main/java/core/basesyntax/Application.java @@ -3,9 +3,10 @@ public class Application { public static void main(String[] args) { // create three balls using class Lottery and print information about them in console - Lottery[] balls = { new Lottery(), new Lottery(), new Lottery() }; - for (Lottery ball : balls) { - System.out.println(ball.getRandomBall()); + for (int i = 0; i < 3; i++) { + Lottery lottery = new Lottery(); + Ball ball = lottery.getRandomBall(); + System.out.println(ball); } } }