I think that all is ok. Text os screan is OK.
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();
NorthAmericanHen nc = new NorthAmericanHen();
System.out.println(nc.getDescription());
Hen hen2 = HenFactory.getHen("asia");
System.out.println(hen2.getDescription());
}
static class HenFactory {
static Hen getHen(String continent) {
Hen hen = null;
if(continent.equalsIgnoreCase("northamerica"))
hen= new NorthAmericanHen();
else if(continent.equalsIgnoreCase("europe")){
hen= new EuropeanHen();
}
else if(continent.equalsIgnoreCase("asia")){
hen= new AsianHen();
}
else if(continent.equalsIgnoreCase("africa")){
hen= new AfricanHen();
}
return hen;
}
}
}