-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
finished #2160
base: master
Are you sure you want to change the base?
finished #2160
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.
Great job on defining the abstract Machine
class! 🎉 It looks like you've set a solid foundation for subclasses to build upon. Just remember for future tasks to make log messages as informative as possible and adhere to Java naming conventions. Keep up the good work! 👍
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
public class Bulldozer extends Machine{ | ||
@Override | ||
public void doWork() { | ||
System.out.println("Bulldozer started working"); |
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.
The message in System.out.println
should indicate the type of machine. Consider changing the message to something more informative like 'Bulldozer is doing its work'.
@@ -0,0 +1,17 @@ | |||
package core.basesyntax; | |||
|
|||
public class Excavator extends Machine{ |
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.
Please remove the redundant empty line after the class declaration as per the checklist.
|
||
@Override | ||
public void doWork() { | ||
System.out.println("Excavator started working"); |
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.
The message in 'doWork' method is not informative enough. According to the checklist, it should indicate what type of Machine is working. Consider specifying the action that Excavator is performing, not just that it started working.
@@ -1,5 +1,14 @@ | |||
package core.basesyntax; | |||
|
|||
public class MainApp { | |||
public static void main(String[] args) { | |||
Machine[] MachineArray = {new Truck(), new Bulldozer(), new Excavator()}; |
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.
Variable names should start with a lowercase letter. Consider renaming MachineArray
to machineArray
to follow Java naming conventions.
@@ -1,5 +1,14 @@ | |||
package core.basesyntax; | |||
|
|||
public class MainApp { | |||
public static void main(String[] args) { | |||
Machine[] MachineArray = {new Truck(), new Bulldozer(), new Excavator()}; |
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.
Use abstract references instead of specific ones where possible. Instead of Machine[] MachineArray
, you should declare Machine[] machines
to adhere to Java naming conventions and to be more descriptive.
@@ -0,0 +1,15 @@ | |||
package core.basesyntax; | |||
|
|||
public class Truck extends Machine{ |
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.
Please remove the redundant empty line after the class declaration (line 2). Following the checklist, we don't need extra empty lines after class declarations or method signatures.
public class Truck extends Machine{ | ||
@Override | ||
public void doWork() { | ||
System.out.println("Truck started working"); |
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.
The message 'Truck started working' could be more informative. According to the checklist, messages should indicate what type of Machine
is working. Consider including the specific action the Truck is performing.
|
||
@Override | ||
public void stopWork() { | ||
System.out.println("Truck stopped working"); |
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.
Similarly, the stopWork message 'Truck stopped working' could be more informative. It should reflect what specific action the Truck has stopped performing.
No description provided.