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

created classes of inheritance #2115

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

Conversation

LynAlinka
Copy link

added psvm to class MainApp

added psvm to class MainApp
Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

It looks like you've made a great effort on this task! However, there are a few improvements that need to be made to ensure your code is as clear and maintainable as possible. Specifically, the work messages in your machine classes should be more descriptive, and the Machine class should be publicly accessible. Making these changes will align your code better with the checklist requirements. Keep up the good work, and with these adjustments, your code will be even better! 👍💻

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

@@ -0,0 +1,15 @@
package core.basesyntax;

class Bulldozer extends Machine {

Choose a reason for hiding this comment

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

The class Bulldozer should have an access modifier. Consider using the public modifier to follow the common convention for classes which are likely to be used from other packages.

class Bulldozer extends Machine {
@Override
public void doWork() {
System.out.println("Bulldozer started working.");

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 fully informative. It should indicate that it is a Bulldozer that is working. Consider changing the message to something like 'Bulldozer is working.' to provide more clarity.


@Override
public void stopWork() {
System.out.println("Bulldozer stopped working.");

Choose a reason for hiding this comment

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

Similarly, the message in stopWork method should be more informative. It should clearly indicate that it is a Bulldozer that has stopped working. A message like 'Bulldozer has stopped working.' would be more informative.

Comment on lines 3 to 13
class Excavator extends Machine {
@Override
public void doWork() {
System.out.println("Excavator started working.");
}

@Override
public void stopWork() {
System.out.println("Excavator stopped working.");

}

Choose a reason for hiding this comment

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

Remember to use informative messages in methods. Instead of 'Excavator started working.', it could be more descriptive, indicating what the Excavator is doing specifically. The same applies to the stopWork method.

@@ -0,0 +1,7 @@
package core.basesyntax;

abstract class Machine {

Choose a reason for hiding this comment

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

The Machine class should be public to ensure that it can be accessed from other packages if needed.


@Override
public void doWork() {
System.out.println("Truck started working");

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' is not very informative. It would be better to indicate what type of work the Truck is performing to make the message more informative as per the checklist.


@Override
public void stopWork() {
System.out.println("Truck stopped working");

Choose a reason for hiding this comment

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

Similarly, the message 'Truck stopped working' should be more informative about the type of work the Truck was doing, to comply with the checklist guidelines.

@Override
public void doWork() {
System.out.println("Bulldozer is working.");

Choose a reason for hiding this comment

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

Suggested change

@Override
public void stopWork() {
System.out.println("Bulldozer has stopped working.");

Choose a reason for hiding this comment

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

Suggested change

@Override
public void stopWork() {
System.out.println("Excavator stopped digging the ground.");

Choose a reason for hiding this comment

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

Suggested change

package core.basesyntax;

class Truck extends Machine {

Choose a reason for hiding this comment

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

Suggested change

@Override
public void stopWork() {
System.out.println("Truck stopped transporting goods.");

Choose a reason for hiding this comment

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

Suggested change

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