after trying to solve so difficult one am i going crazy or it is a bug
Hi!
Now you're going to dig into the Factory Method pattern. Let's take people as an example.
We'll determine what type of person someone is depending on his or her age.
In this task, we'll prepare the data that we'll use in the factory.
1. Create a shared Human interface for all types of people.
2. Let's make a factory for men. To do this, create a male package and create KidBoy, TeenBoy, and Man classes in it.
Implement the Human interface in each of these classes.
3. Create public MAX_AGE constants in the KidBoy and TeenBoy classes with the values 12 and 19, respectively.
4. Automatically generate toString methods for the KidBoy, TeenBoy, and Man classes. The result must be "KidBoy{}", etc.
5. Create a Solution class with a main method.
Requirements:
- The Human interface must be created in the base package of the big task.
- The KidBoy, TeenBoy, and Man classes must be placed in the male package and support the Human interface.
- The toString method must be overridden in the KidBoy, TeenBoy, and Man classes as outlined in the task conditions.
- The KidBoy class's MAX_AGE constant must be equal to 12.
- The TeenBoy class's MAX_AGE constant must be equal to 19.
- A public static void main(String[] args) method must be created in the Solution class.
package com.codegym.task.task37.task3702;
public class Solution {
public static void main(String[] args){
}
}