Skip to content

Commit 7b31379

Browse files
committed
made changes2
1 parent ebc83b9 commit 7b31379

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

src/main/java/core/basesyntax/Ball.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
package core.basesyntax;
22

33
public class Ball {
4-
private String color;
5-
private int number;
4+
private String color;
5+
private int number;
66

7-
public Ball(String color, int number) {
8-
this.color = color;
9-
this.number = number;
10-
}
11-
@Override
7+
public Ball(String color, int number) {
8+
this.color = color;
9+
this.number = number;
10+
}
11+
12+
@Override
1213
public String toString() {
1314

1415
return "Ball{" + "color= " + color + "number= " + number;
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package core.basesyntax;
2+
23
import java.util.Random;
4+
35
public class ColorSupplier {
46
public Colors getRandomColor() {
57
Random random = new Random();
68
int index = random.nextInt(Colors.values().length);
79
return Colors.values()[index];
8-
}
910
}
11+
}
1012

1113

src/main/java/core/basesyntax/Lottery.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ public class Lottery {
66
public static Colors getRandomBall() {
77
ColorSupplier colorSupplier = new ColorSupplier();
88
Colors randomColor = colorSupplier.getRandomColor();
9-
return randomColor;
9+
return randomColor;
1010

11-
}
1211
}
12+
}
1313

1414

0 commit comments

Comments
 (0)