Errors in Java add and get

-1

Good evening, I've run into two errors that I do not know how to solve, I've tried everything I know and asked friends, but not even with those. The code is this:

public int getButacasDisponiblesSesion (int sesion){
   return this.sesiones.get(sesion -1).getButacasDisponiblesSesion();
   }

public ButacasContiguas recomendarButacasContiguas (int noButacas, int 
sesion){
     return this.sesiones.get(sesion-
1).recomendarButacasContiguas(noButacas,sesion);   
   }
public void comprarEntradasRecomendadas (int sesion, ButacasContiguas 
butacas){
  this.sesiones.get(sesion - 1).comprarEntradasRecomendadas(sesion,butacas);
}
public void incluirSesion(String horaSesion){
  int pos = 0;
while (pos < this.sesiones.size() && 
this.sesiones.get(pos).getHora().copareTo(horaSesion)){
  pos ++;
}
this.sesiones.add(pos, new Sesion(horaSesion, this.filas, this.columnas));

}

And the errors that I miss are:

  

The method getButacasDisponiblesSesion (int) in the type room is not applicable> for the arguments ().

     

The method add (int, room) in the type ArrayList is not applicable for the arguments (int, Session).

I must say that I have getButacasDisponibesSesion defined in another class Session.

Thank you very much in advance: -)

If you need more information ask for it, I'm new here and I do not know if it's the best way to ask and explain.

    
asked by Daniel Pérez 21.04.2017 в 01:08
source

1 answer

0

The problem of the ArrayList add I think is that the method must receive a single parameter and this must be of the type of the ArrayList defined. In your example I suppose that your list is of objects session and therefore the pos parameter, surplus.

    
answered by 21.04.2017 в 09:16