When I try to put strings in the monster constructor it comes back with symbol not found and I am unsure as to why
Java:
public class Monster {
private String name;
private String[] types;
private Move[] moveList = new Move[4]
public Monster (String name, String type) {
this.name = name;
this.types = new String[]{type};
}
public Monster (String name, String type1, String type2) {
this.name= name;
this.types = new String[]{type1, type2};
}
public String getName() {
return this.name;
}
public Boolean hasType(String type) {
for (String item: this.types){
if (type.equals(item)){
return true;
}
}
return false;
}
public Move getMove(int index) {
return moveList[index];
}
public void setMove(int index, Move move) {
moveList[index] = move;
}
public String toString(){
return this.name + " (" + this.type1 + "): " + this.type2;
}
}
Last edited by a moderator: