Array before.
String[] player = {"Empty","Empty","Empty","Empty"}
Array after input.
String[] player = {"Tom","Bob","Alex","Kid"}
I remember there was a way to check all of the elements of the array.
if(!player[0].equals("Empty") && !player[1].equals("Empty") && !player[2].equals("Empty") && !player[3].equals("Empty"))
{
System.out.println("No more space");
}
My question. Is there a way to select all of the elements of an array?
You can iterate over the array implicitly:
or iterate over the array explicitly: