Does this way of adding a string to an Array List work? When a player is level 2+ , a new enemy should be added to the Array List. I am only showing the code that is important to the question but basically a random enemy is chosen from the Array List for the player to face.
int level = player.level;
ArrayList<String> enemies2 = new ArrayList<String>(); {
if (level >= 2) {
enemies2.add("Giant");
}
enemies2.add("Skeleton");
enemies2.add("Zombie");
enemies2.add("Warrior");
enemies2.add("Assassin");
enemies2.add("Reaper");
enemies2.add("Archer");
}