What does it mean that hens must be in separate files? I thought it means separate classes
getMonthlyEggCount must return int... It does...
When i print it everything looks ok so I can't figure out where the mistake is.
package com.codegym.task.task14.task1408;
/*
Chicken factory
*/
public class Solution {
public static void main(String[] args) {
Hen hen = HenFactory.getHen(Continent.NORTHAMERICA);
hen.getMonthlyEggCount();
//System.out.println(hen.getMonthlyEggCount());
//System.out.println(hen.getDescription());
}
static class HenFactory {
static Hen getHen(String continent) {
Hen hen = null;
if (continent.equals(Continent.NORTHAMERICA)){
hen = new AmericanHen();
}
else if (continent.equals(Continent.EUROPE)){
hen = new EuropeanHen();
}
else if (continent.equals(Continent.ASIA)){
hen = new AsianHen();
}
else if (continent.equals(Continent.AFRICA)){
hen = new AfricanHen();
}
return hen;
}
}
}