Why can't you place a print statement after this type of for loop? I don't understand what's going on. I understand this is not the standard way to write a for loop. So I was experimenting with this code because I saw this code somewhere. I just don't understand why you can't place the print statement at the end.
public class Test{
public static void main(String [] args){
for( ; ; ) {
int x = 0;
if (x < 5) {
System.out.print(x + " ");
x++;
}
}
System.out.println("The End"); //This line will not compile.
}
}