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

jv-oop done #2118

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

Conversation

VolodymyrNyshta
Copy link

No description provided.

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.

Great job on implementing polymorphism in your MainApp class! 👍 The abstract Machine class with its methods is well-defined too. Just remember to make the messages in your doWork and stopWork methods more informative in the future. This will make your application's output clearer to users. Keep up the good work! 🌟

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

Machine bulldozer = new Bulldozer();
Machine truck = new Truck();
Machine[] machines = new Machine[] {excavator, bulldozer, truck};
for(Machine machine : machines) {

Choose a reason for hiding this comment

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

There should not be an empty space between the 'for' keyword and the opening parenthesis to adhere to Java coding standards.


@Override
public void doWork() {
System.out.println("Bulldozer started work");

Choose a reason for hiding this comment

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

The message 'Bulldozer started work' should be more informative. It's better to indicate that it is a Bulldozer that is working now. For example, 'Bulldozer is now in operation.'


@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.

The stop message 'Bulldozer stopped working' could be more informative as well. Consider rephrasing it to 'Bulldozer has stopped working.' to make it clear that the Bulldozer has ceased operations.


@Override
public void doWork() {
System.out.println("Excavator started work");

Choose a reason for hiding this comment

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

The message printed by the doWork method should be more informative. According to the checklist, it should indicate the type of machine that is working. Consider updating the message to include the specific type of Machine, such as 'Excavator is starting its work.'


@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.

Similar to the doWork method, the message in stopWork should also be more informative and indicate the type of machine that stopped working. Update the message to reflect this, for example, 'Excavator has stopped its work.'


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

Choose a reason for hiding this comment

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

The message in the doWork method should be more informative. According to the checklist, it should indicate what type of Machine is working. Consider specifying that this is a Truck doing some specific work, for example, 'Truck is hauling cargo'.


@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 in the stopWork method should be more informative and indicate that the Truck has stopped doing its specific work, for example, 'Truck has finished hauling cargo'.

README.md Outdated
Comment on lines 3 to 4
- Create class core.machines.Machine containing methods `public abstract void doWork()` and `public abstract void stopWork()`.
- Create classes `core.machines.Truck`, `core.machines.Bulldozer`, and `core.machines.Excavator` that will inherit from `core.machines.Machine`.
Copy link

Choose a reason for hiding this comment

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

be careful with project-wide renamings, moving files - review your files before committing to avoid unintended changes, please undo the change

public abstract void doWork();

public abstract void stopWork();

Copy link

Choose a reason for hiding this comment

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

Suggested change

package core.machines;

public abstract class Machine {

Copy link

Choose a reason for hiding this comment

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

Suggested change

package core.machines;

public class Truck extends Machine {

Copy link

Choose a reason for hiding this comment

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

Suggested change

Copy link

@MentorMateAcademy MentorMateAcademy left a comment

Choose a reason for hiding this comment

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

clear redundant empty lines

Copy link

@Elena-Bruyako Elena-Bruyako left a comment

Choose a reason for hiding this comment

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

Copy link

@okuzan okuzan left a comment

Choose a reason for hiding this comment

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

There should be no changes to this file, please undo them
image

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.

5 participants