File tree Expand file tree Collapse file tree 3 files changed +13
-10
lines changed
src/main/java/core/basesyntax Expand file tree Collapse file tree 3 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 1
1
package core .basesyntax ;
2
2
3
3
public class Ball {
4
- private String color ;
5
- private int number ;
4
+ private String color ;
5
+ private int number ;
6
6
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
12
13
public String toString () {
13
14
14
15
return "Ball{" + "color= " + color + "number= " + number ;
Original file line number Diff line number Diff line change 1
1
package core .basesyntax ;
2
+
2
3
import java .util .Random ;
4
+
3
5
public class ColorSupplier {
4
6
public Colors getRandomColor () {
5
7
Random random = new Random ();
6
8
int index = random .nextInt (Colors .values ().length );
7
9
return Colors .values ()[index ];
8
- }
9
10
}
11
+ }
10
12
11
13
Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ public class Lottery {
6
6
public static Colors getRandomBall () {
7
7
ColorSupplier colorSupplier = new ColorSupplier ();
8
8
Colors randomColor = colorSupplier .getRandomColor ();
9
- return randomColor ;
9
+ return randomColor ;
10
10
11
- }
12
11
}
12
+ }
13
13
14
14
You can’t perform that action at this time.
0 commit comments