I have two classes, Game and ScoreBoard. I want an instance of ScoreBoard to be generated automatically when I create an instance of Game.
The ScoreBoard constructor looks like this:
public void ScoreBoard(String player1, String player2)
{
p1Name = player1;
p2Name = player2;
p1Score = 0;
p2Score = 0;
}
and the constructor of the Game class looks like this:
public Game()
{
//irrelevant code redacted
ScoreBoard scores = new ScoreBoard(p1, p2);
}
when I try to compile, I get the following message:
cannot find symbol - constructor ScoreBoard(java.lang.String,java.lang.String)