-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
solved the task jv-oop-advanced #1285
base: master
Are you sure you want to change the base?
Conversation
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.
Well done, but there are some minor changes that should be done. You made a great work.
@@ -0,0 +1,5 @@ | |||
package core.basesyntax; | |||
|
|||
public interface Printer { |
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.
If you have method draw()
maybe does it better to have class name as Drawer
?
} | ||
|
||
public Figure getDefaultFigure() { | ||
return new Circle(Color.WHITE.name(), 10); |
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.
All magic numbers in your code should be constants.
Please see this article to learn about constant fields and their naming requirements.
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.
Good job. But please, pay attention to my comments.
int index = random.nextInt(Color.values().length); | ||
return Color.values()[index].name(); |
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.
I think you can storeColor.values()
result as a class field.
int figureNumber = random.nextInt(FIGURE_COUNT); | ||
switch (figureNumber) { |
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.
You can simplify it with switch (random.nextInt(FIGURE_COUNT))
.
|
||
public static void main(String[] args) { | ||
FigureSupplier figureSupplier = new FigureSupplier(); | ||
|
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.
That line is redundant.
No description provided.