-
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
implemented the task by creating all the classes and methods #1716
base: master
Are you sure you want to change the base?
implemented the task by creating all the classes and methods #1716
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.
Thank you for your hard work on this task! 😊 However, there are a few critical issues that need to be addressed before we can approve your submission. The Ball
, Colors
, and Lottery
classes are missing, which are essential components of the task. These classes are crucial for the functionality of your application as they define the core logic and structure. Please implement these classes with the necessary fields and methods as described in the task requirements. Once these changes are made, your solution will be much closer to completion. Keep up the great effort, and don't hesitate to reach out if you need any help! 🚀
✨ 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.
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.
Review Summary
🎉 Great job on implementing the required classes and methods! Your solution meets the task requirements and constraints, and all necessary components are present. Here are some highlights and suggestions for improvement:
-
Ball Class: Well-implemented with private fields and appropriate methods. The
toString()
method is correctly overridden. No changes needed here. -
Colors Enum: Correctly defined with color constants. This is used effectively in the
ColorSupplier
class. -
ColorSupplier Class: Appropriately uses the
Random
class to provide a random color from theColors
enum. Well done! -
Lottery Class: Generates a random
Ball
object with a random color and number. This is implemented correctly. -
Application Class: Successfully creates and prints three
Ball
objects. However, consider refactoring your code to use a loop for creating and printing the balls to avoid redundancy and improve maintainability.
Your code is functional, and the decision to approve is made to help you move forward with your learning. Please review the comments to improve your code, especially regarding the use of loops to create multiple objects. Addressing these suggestions will enhance your coding skills and help avoid similar issues in the future. Keep up the good work and continue learning! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
Lottery lottery = new Lottery(); | ||
Ball firstBall = lottery.getRandomBall(); | ||
System.out.println(firstBall); | ||
Ball secondBall = lottery.getRandomBall(); | ||
System.out.println(secondBall); | ||
Ball thirdBall = lottery.getRandomBall(); | ||
System.out.println(thirdBall); |
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.
Instead of creating each Ball
object separately, consider using a loop to create and print the balls. This approach will make your code cleaner and more maintainable. Refer to the checklist for an example of how to use a loop for creating multiple objects .
No description provided.