My method is as follows:
public boolean addJugador(String nombre){
boolean add=true;
Jugador j= new Jugador(nombre);
if(nombre!=mesa[jugadoresActuales].getNombre()){
mesa[jugadoresActuales]= j;
jugadoresActuales++;
}else{
add=false;
}
return add;
}
The method getNombre
is:
public String getNombre(){
return nombre;
The player builder is
public Jugador(String nombre){
this.nombre=nombre;
manoJugador=new Carta[MAXCARTAS];
cartasActuales=0;
Current players is initialized to 0. Mesa is a player-type array that keeps players added, and current players is the number of players. I do not understand at what point I'm pointing to null, any ideas?