Thursday, 8 August 2013

While Loop Compiler Error

While Loop Compiler Error

I am trying to create a while loop, but the compiler keeps saying I have
an "illegal start of type." How do I fix this?
code:
class whileLoop
{
int p = 0;
while(p < 10)
{
System.out.println(p);
p++;
}
}

No comments:

Post a Comment