abstract static class Hen{
abstract int getCountOfEggsPerMonth();
String getDescription(){ return "Я - курица.";}
}
ublic class BelarusianHen extends Solution.Hen implements Country {
public int getCountOfEggsPerMonth() {
return 2;
}
public String getDescription() {
String res = super.getDescription() + " Моя страна - "+Country.BELARUS+". Я несу " + this.getCountOfEggsPerMonth() + " яиц в месяц.";
return res;
}
}
static class HenFactory {
static Hen getHen(String country) {
Hen hen = null;
if (country.equals(Country.RUSSIA)) hen = new RussianHen();
else if (country.equals(Country.BELARUS)) hen = new BelarusianHen();
else if (country.equals(Country.MOLDOVA)) hen = new MoldovanHen();
else if (country.equals(Country.UKRAINE)) hen = new UkrainianHen();
return hen;
}
}
Прошу помощи - в чем моя ошибка?