i'm new to programming. I'm trying to make a class who start with :
public class Team {
String teamName;
String [] player= new String[4];
Competition [] competitions=new Competition[2];
public Team (String newTeamnName, String [] newPlayer, Competition [] newCompetition) {
teamName= newTeamnName;
player= newPlayer;
competitions=newCompetition;
}
but when using the constructor whith this:
public class TeamDemo {
public static void main (String [] arg){
Team marc=new ("marcTeam",{"marcello","dfsf","sdfsd"},{"comp1","comp2"})
}
I get an error message about the array {"marcello","dfsf","sdfsd"}
and {"comp1","comp2"}
that array initializer is not allowed here.
I can't declare a class object with arrays in the parameter ?