whenever I compile my code, I receive the following errors:
error: constructor Player in class Player cannot be applied to given types;
but it doesn't list any types. The code in question is
public class Team {
private String name;
public Player players[];
public Player temp;
public Team(String inputname, Player players[]) {
inputname = name;
this.players = new Player [players.length];
for( int k=0 ; k<players.length ; k++ )
this.players[k] = new Player(players[k]); //This is the line with errors.
}
The Player class is found below:
public class Player {
public String[] name;
public Player(String inputname) {
name = inputname.split(" ");
}}
Can someone please tell me what is wrong here? If it helps, on the line with errors, players[k] would be a name-like string, such as "Billy Bob."