When I run my method to print out the array, it will give me a NullPointerException and I have no idea how to get it to just print what I want. Let's say I want Array[0] to be "Sally" and Array[3] to be "Jeff", I want it to print out 0, Sally 3, Jeff. While leaving all the null slots of the array alone.
Here's my code:
public void printAll()
{
for(int i = 0; i <= 10; i++)
{
if(seats[i].equals(null))
{
System.out.print(i + " , " + seats[i] + "\n");
}
}
}
Any help would be greatly appreciated, if I'm being too vague I can reply with more details.