I am having trouble getting my enum to work when I try to create a new class and construct it.
This is my enum values for now. I am creating a monster that will have various attributes including its elemental type.public enum MonsterType{ FIRE, WATER, EARTH, AIR }
When I try to construct my monster like this:
Netbeans says "cannot find symbol".Monster mymonster = new Monster("Goofy", 20, 10, 4, 3, 1, MonsterType.FIRE);
My constructor looks like this:
public Monster(String monsterName, int monsterHealth, int monsterAttack, int monsterDefense, int monsterSpecialAttack, int monsterSpecialDefense, MonsterType monsterType ){ name = monsterName; health = monsterHealth; attack = monsterAttack; defense = monsterDefense; specialAttack = monsterSpecialAttack; specialDefense = monsterSpecialDefense; type = monsterType; xp = 1000;
So a few questions I have are:
Can I send the enum value like this or is my syntax wrong?
Also if I am using my main.java to make new monsters, can I just declare the enum MonsterType in the main.java class or does it also have to be in Monster class where the constructor is?