KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > First


1
2 public class First {
3
4     public static void main(String JavaDoc args[]) {
5         int sum = 0;
6         
7         First f = new First();
8         f.foo();
9         
10         for (int i = 1; i < 10; i++) {
11             int x, y;
12             x = i + 1;
13             y = i + 1;
14             sum = sum + x + y + 1;
15         }
16         System.out.println(sum);
17     }
18     
19     public void foo() {
20         System.out.println("Hi there!");
21     }
22 }
23
Free Books   Free Magazines  
Popular Tags