我正在开发一个程序,我想要一个布尔数组来返回座位的状态。
False = empty.
boolean seats [] = new boolean[10];
for(int i = 0; i<seats.length; i++)
seats [i] = false;
for(int c = 0; c<seats.length; c++)
while (seats[c] = false)
System.out.printf("Seat %d is empty\n",c);
我希望这个数组返回。
Seat 1 is empty
Seat 2 is empty
Seat 3 is empty
[...]
如何使错误的返回字符串为空。
谢谢