-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Created ENUM, Ball, Color, Lottery classes. Implemented methods in th… #1704
base: master
Are you sure you want to change the base?
Conversation
…em according to the given task. Tested the program using the Main class.
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.
Thank you for your hard work on this project! 🎉 While your code is mostly well-implemented, there are a couple of minor issues that need to be addressed before we can approve the pull request. Specifically, there are typographical errors: one in the Ball
class's toString
method where "colore" should be "color", and another in the Color
enum where "YELLOU" should be "YELLOW". Once these are corrected, your code will be ready to go! Keep up the great work! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review
button in the Reviewers tab.
|
||
@Override | ||
public String toString() { | ||
return "Return Ball with number:" + number + " and " + color + " colore"; |
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.
There is a typo in the toString
method. The word 'colore' should be corrected to 'color'.
BLACK, | ||
WHITE, | ||
GREEN, | ||
YELLOU, |
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.
There is a typo in the color name 'YELLOU'. It should be corrected to 'YELLOW'.
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.
Great job on implementing the solution! 🎉 Your code meets the task requirements and constraints, and you've addressed most of the previous issues. Here are a few suggestions to further enhance your code:
-
Magic Number: In
Application.java
, consider replacing the magic number3
with a constant, such asprivate static final int NUMBER_OF_BALLS = 3;
. This will improve the readability and maintainability of your code. -
Typographical Consistency: In
Ball.java
, thetoString
method could be more consistent with typical string representations. Consider changing "Return Ball with number:" to "Ball with number: ".
These are minor improvements, but addressing them will help you write cleaner and more maintainable code. Keep up the great work, and continue learning from each iteration! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
// create three balls using class Lottery and print information about them in console | ||
Lottery lottery = new Lottery(); | ||
|
||
for (int i = 0; i < 3; i++) { |
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.
Consider replacing the magic number 3
with a constant. This will improve the readability and maintainability of your code. For example, you could define a constant private static final int NUMBER_OF_BALLS = 3;
and use it in the loop condition.
|
||
@Override | ||
public String toString() { | ||
return "Return Ball with number:" + number + " and " + color + " color"; |
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.
Typographical error: The string in the toString
method should be more consistent with typical string representations. Consider changing "Return Ball with number:" to "Ball with number: ".
…em according to the given task. Tested the program using the Main class.