KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ForLoopTest


1 public class ForLoopTest {
2     
3     public static void main(String JavaDoc[] args) {
4         for (int i = 0; i < 10; i++)
5             System.out.print(i + " ");
6         for (int i = 10; i > 0; i--)
7             System.out.print(i + " ");
8         System.out.println();
9         
10         int i;
11         class Local {
12             {
13                 for (int i = 0; i < 10; i++)
14                 System.out.println(i);
15             }
16         }
17         new Local();
18     }
19
20 }
21
Popular Tags