I am unsure on why the super.<<method>> will not work, is it to do with not using an IDE instead of codegym?
Am i meant to connect the separate chicken classes to the main?
any help is appreciated.
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
switch(continent) {
case Continent.AFRICA:
hen = new AfricanHen();
break;
case Continent.EUROPE:
hen = new EuropeanHen();
break;
case Continent.NORTHAMERICA:
hen = new NorthAmericanHen();
break;
case Continent.ASIA:
hen = new AsianHen();
break;
}
return hen;
}
}
}