Skip to content

Conversation

oksana-feshchenko
Copy link

No description provided.


public String getRandomColor() {
return null;
return Color.values()[new Random().nextInt(0, Color.values().length)].name();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please make random object as a class member

public class Lottery {

public Ball getRandomBall() {
return new Ball(new ColorSupplier().getRandomColor(), new Random().nextInt(0, 100));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please make ColorSupplier and Random object as a class members.
please do not use magic number, and think about upper number (maybe 101?)

Copy link

@d1sam d1sam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To test the program, in the main() method, create three balls using the getRandomBall() method from the Lottery class. And print information about them in the console.
fix all the issues described.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants