I am new to StackOverflow and also programming in Java. I am going through exercises that I did in pseudocodigo to Java, and I find an error that I can not solve in the for loop.
The idea of the exercise is to create a vector that contains free and occupied cinema seats, then go through the vector and return the number of seats occupied.
I transcribe the code:
public class butacasdecine {
public static void main (String[] args)
{
int [] butacas = {1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1};
int contador = 0;
for (int i=0; i=11; i++)
{
if (butacas[i]==1);
contador++;
}
System.out.println("Butacas ocupadas: " +contador);
}
The error appears in the line of'for (int i = 0 ... 'and says verbatim: "incompatible types: int can not be converted to boolean
The assigned value is never used "
Thanks for the help !!