Can someone, please, explain to me why my code is not passing validation?
package com.codegym.task.task14.task1408;
/*
Chicken factory
*/
public class Solution {
public static void main(String[] args) {
Hen NAHen = HenFactory.getHen(Continent.NORTHAMERICA);
Hen EUHen = HenFactory.getHen(Continent.EUROPE);
Hen AsHen = HenFactory.getHen(Continent.ASIA);
Hen AfHen = HenFactory.getHen(Continent.AFRICA);
int eggsMonthly;
if ((eggsMonthly = NAHen.getMonthlyEggCount()) > 0)
System.out.println(NAHen.getDescription());
if ((eggsMonthly = EUHen.getMonthlyEggCount()) > 0)
System.out.println(EUHen.getDescription());
if ((eggsMonthly = AsHen.getMonthlyEggCount()) > 0)
System.out.println(AsHen.getDescription());
if ((eggsMonthly = AfHen.getMonthlyEggCount()) > 0)
System.out.println(AfHen.getDescription());
}
static class HenFactory {
static Hen getHen(String continent) {
Hen hen = null;
//write your code here
if ("NorthAmerica".equalsIgnoreCase(continent)) {
hen = new NorthAmericanHen(continent);
} else if ("Europe".equalsIgnoreCase(continent)) {
hen = new EuropeanHen(continent);
} else if ("Asia".equalsIgnoreCase(continent)) {
hen = new AsianHen(continent);
} else if ("Africa".equalsIgnoreCase(continent)) {
hen = new AfricanHen(continent);
}
return hen;
}
}
}