I'm trying to build an array of objects of the Question class. Its constructor method is the following:
public Pregunta(String pregunta, String[] respuestas, int posicicionRespuesta) {
this.pregunta = pregunta;
this.respuestas = respuestas;
this.posicion = posicicionRespuesta;
}
When I try to build it from the Game class, and start writing the parameters, an error appears: illegal start of expression
public class Juego {
Pregunta[][] clasePreguntas;
Categorias[] categoria;
Jugador[] jugadores;
public Juego() {
clasePreguntas = new Pregunta[5][5];
categoria = new Categorias[5];
jugadores = new Jugador[10];
}
public void llenarMatrizPreguntas() {
clasePreguntas[0][0] = new Pregunta("¿Cual es el apellido de Rodolfo?",{"Rodriguez","Maduro","Ordonez"}, 5);
}
So how can I get it to recognize the received array as a parameter?