Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nshtykh
Copy link

@nshtykh nshtykh commented Sep 28, 2023

No description provided.

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.

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 {
Copy link

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);
Copy link

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.

@nshtykh nshtykh requested a review from d1sam October 2, 2023 08:03
Copy link

@bhdnchui bhdnchui left a 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.

Comment on lines +9 to +10
int index = random.nextInt(Color.values().length);
return Color.values()[index].name();
Copy link

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.

Comment on lines +14 to +15
int figureNumber = random.nextInt(FIGURE_COUNT);
switch (figureNumber) {
Copy link

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();

Copy link

Choose a reason for hiding this comment

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

That line is redundant.

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.

3 participants