Skip to content

Попытался сделать. Явно получилось не так как надо, во втором задании…#22

Open
dmithorzh wants to merge 4 commits intoiaulitin:masterfrom
dmithorzh:master
Open

Попытался сделать. Явно получилось не так как надо, во втором задании…#22
dmithorzh wants to merge 4 commits intoiaulitin:masterfrom
dmithorzh:master

Conversation

@dmithorzh
Copy link

Попытался сделать. Явно получилось не так как надо, во втором задании я вообще не понял как реализовать метод goRotten, почитал про java timer, но не понял как имплементировать его в данном случае, если это вообще возможно.

… я вообще не понял как реализовать метод goRotten, почитал про java timer, но не понял как имплементировать его в данном случае, если это вообще возможно.


double real;
double imaginary;
Copy link
Owner

Choose a reason for hiding this comment

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

Инкапсуляция?

Copy link
Owner

Choose a reason for hiding this comment

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

А зачем protected?

}
@Override
public String toString() {
return this.getName();
Copy link
Owner

Choose a reason for hiding this comment

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

Тут то же самое про геттеры, на самом деле. Ты же можешь к полю обращаться напрямую - зачем вызывать геттер?

Copy link
Owner

Choose a reason for hiding this comment

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

Не исправлено.

@@ -0,0 +1,37 @@
package ru.milandr.courses.farm.tkhorzhevskiy;
Copy link
Owner

Choose a reason for hiding this comment

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

По всем своим классам автоформатированием пройтись, так не годится

import ru.milandr.courses.farm.tkhorzhevskiy.goods.Meat;

public class Pig extends ParentAnimal {
private static final String PigName = "Свинья";
Copy link
Owner

Choose a reason for hiding this comment

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

Мы этого еще пока не проходили, но константы static final в Джаве пишутся в UPPER_CAMEL_CASE. Надо поправить везде, где используешь их.

public void produceSound() {
System.out.println("Какой то звук");

}
Copy link
Owner

Choose a reason for hiding this comment

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

А чего абстрактным не сделал?
И опять пустые строки

@Override
public Good produceGoods() {
return null;
}
Copy link
Owner

Choose a reason for hiding this comment

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

Тоже абстрактным можно сделать.

}
@Override
public String toString() {
return this.getName();
Copy link
Owner

Choose a reason for hiding this comment

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

Не исправлено.

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.

2 participants

Comments