-
Notifications
You must be signed in to change notification settings - Fork 1.5k
lottety-hw-01 #1575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
lottety-hw-01 #1575
Changes from 5 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package core.basesyntax; | ||
|
||
public class Ball { | ||
private String color; | ||
private int number; | ||
|
||
public Ball(String color, int number) { | ||
this.number = number; | ||
this.color = color; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Ball{" | ||
+ "color=" + color | ||
+ ", number=" + number | ||
+ '}'; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,5 @@ | ||||||||||||||||||
package core.basesyntax; | ||||||||||||||||||
|
||||||||||||||||||
public enum Color { | ||||||||||||||||||
RED, GREEN, BLUE, YELLOW, ORANGE, BLACK, WHITE | ||||||||||||||||||
|
RED, GREEN, BLUE, YELLOW, ORANGE, BLACK, WHITE | |
RED, | |
GREEN, | |
BLUE, | |
YELLOW, | |
ORANGE, | |
BLACK, | |
WHITE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not fixed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
package core.basesyntax; | ||
|
||
import java.util.Random; | ||
|
||
public class ColorSupplier { | ||
private Random random = new Random(); | ||
|
||
public String getRandomColor() { | ||
return null; | ||
Color[] colors = Color.values(); | ||
|
||
return colors[random.nextInt(colors.length)].name(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,15 @@ | ||||||
package core.basesyntax; | ||||||
|
||||||
import java.util.Random; | ||||||
|
||||||
class Lottery { | ||||||
|
class Lottery { | |
public class Lottery { |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make it constant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should be constant