import java.util.ArrayList; public class Main { public static void main(String[] args) { // 空の ArrayList ArrayList enemies = new ArrayList<>(); Player p = new Player(3000); Alice a = new Alice(100); enemies.add(a); Grace g = new Grace(100, 2); enemies.add(g); Boss b = new Boss(); enemies.add(b); for (int i = 0; i < 3; i++) { for (int j = 0; j < enemies.size(); j++) { Enemy e = enemies.get(j); e.attack(p); } } } }