Write a code in Java programming You are working in a game company that is developing a new RPG game. One of the core features of the game is the ability to create and manage different types of characters, such as warriors, mages, and archers. However, your colleague, who was previously working on the implementation of the CharacterManager class, has been laid off due to excessive absences. You have been assigned to take over the project and complete the implementation of the class based on the design specifications outlined below: Given the following main method: public static void main(String[] args) { CharacterManager manager = CharacterManager.getInstance(); manager.createCharacter(CharacterType.WARRIOR).attack(); manager.createCharacter(CharacterType.MAGE).attack(); manager.createCharacter(CharacterType.ARCHER).attack(); } Your output should be: Warrior is attacking Mage is attacking Archer is attacking Note that you should not change the method signature.
Write a code in Java programming
You are working in a game company that is developing a new RPG game. One of the core features of the game is the ability to create and manage different types of characters, such as warriors, mages, and archers.
However, your colleague, who was previously working on the implementation of the CharacterManager class, has been laid off due to excessive absences.
You have been assigned to take over the project and complete the implementation of the class based on the design specifications outlined below:
Given the following main method:
public static void main(String[] args) {
CharacterManager manager = CharacterManager.getInstance(); manager.createCharacter(CharacterType.WARRIOR).attack(); manager.createCharacter(CharacterType.MAGE).attack(); manager.createCharacter(CharacterType.ARCHER).attack();
}
Your output should be:
Warrior is attacking
Mage is attacking
Archer is attacking
Note that you should not change the method signature.
Step by step
Solved in 4 steps with 4 images