From 427509593025c20f8147fd640333300a31bd85ad Mon Sep 17 00:00:00 2001 From: xMax Date: Tue, 31 Dec 2024 14:59:54 +0100 Subject: [PATCH] solution 3 --- src/main/java/core/basesyntax/Application.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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); } } }