I am prompting the user to enter their name as well as adding an ai player to my ArrayList. Unfortunately, I am receiving a "cannot find symbol" error on the words "add" in my code below. I am assuming it's something along the lines of not importing something, I can't seem to quite figure it out at the moment.
package connectfour;
import java.util.ArrayList;
import javax.swing.*;
import userInterface.Connect4Ui;
import core.Player;
import core.HumanPlayer;
import core.AiPlayer;
/**
*
* @author j_ortiz9688
*/
// connect 4 main
public class ConnectFour {
private static ArrayList<Player>player;
private static Connect4Ui frame;
public static void makePlayers(){
player = new ArrayList<Player>();
String name = JOptionPane.showInputDialog("Enter your name");
HumanPlayer player = new HumanPlayer(name);
AiPlayer ai = new AiPlayer("Computer", 0);
player.add(player);
player.add(ai);
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
frame = new Connect4Ui();
}
}