After many attempts, I don’t understand why it always reject requirements 5 and 6.
Maybe I didn’t well understand something from the requirements, I don’t know.
The program seems to be working.
package com.codegym.task.task14.task1408;
/*
Chicken factory
*/
public class Solution {
public static void main(String[] args) {
Hen hen = HenFactory.getHen(Continent.AFRICA);
hen.getMonthlyEggCount();
}
static class HenFactory {
static Hen getHen(String continent) {
Hen hen = null;
//write your code here
if (continent.equals(Continent.EUROPE)) {
hen = new EuropeanHen(continent, 24);
} else if (continent.equals(Continent.NORTHAMERICA)) {
hen = new NorthAmericanHen(continent, 22);
} else if (continent.equals(Continent.ASIA)) {
hen = new AsianHen(continent, 25);
} else if (continent.equals(Continent.AFRICA)) {
hen = new AfricanHen(continent, 28);
}
return hen;
}
}
}