for loop in Java

Variables defined in loop cannot be used outside the loop.
Curly brace is optional. If for loop doesn't contain curly braces, only one statement following the for loop belongs to loop body.
```
public class Main {
	public static void main(String[] args) {
        for(int i=0; i<10; i++)
            System.out.println(i);
        System.out.println(i);    //error: cannot find symbol
	}
}
```