KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ArrayFieldsTest


1 public class ArrayFieldsTest {
2
3     private int [] column = new int[4];
4     
5     {
6         for (int i = 0; i < 4; i++) {
7             column[i] = 4;
8         }
9     }
10     
11     public static void main(String JavaDoc [] args) {
12     
13         ArrayFieldsTest aft = new ArrayFieldsTest();
14         aft.run();
15     }
16
17     private void run() {
18         int i = 0;
19         while(column[i] != 32) {
20             System.out.println(column[i]);
21             column[i] += column[i];
22         }
23         System.out.println(column.length);
24     }
25 }
26
Popular Tags