Reputation: 15
I was just starting a small program for fun and I got the error
Syntax error on token ";", { expected after this token
after the static int declaration.
class Counter {
public static int counter;
for(;;) {
}
}
public class Application {
public static void main(String args[]) {
}
}
Upvotes: 0
Views: 83
Reputation: 159754
The for
statement should be in a code block such as method rather than the class block
Upvotes: 3