I have used the writer before but for some reason I am having trouble implementing it in the following method. I have never put the writer in a static method.
//replace an empty seat with a person in the seating chart
public static void seatingChart(String seat[]) {
for(int i = 0; i < seat.length; i++) {
if(seat[i]!=null) {
System.out.print(seat[i] + " ");
} else {
System.out.print("empty seat ");
}
if(i % 8 == 0) {
System.out.println();
}
}
}
Does anything change for using the writer in java when the method is static compared to when the method is not?
I have only got the writer to print "empty seat" in the notepad once so far.
The final output I want to see in the notepad would be something like this:
empty seat
empty seat empty seat empty seat empty seat empty seat empty seat empty seat empty seat
empty seat empty seat empty seat empty seat empty seat empty seat empty seat empty seat
empty seat empty seat empty seat empty seat empty seat empty seat empty seat
Depending on what the user enters, some of the empty seats may have a name.