KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > StaticConstantsTest


1 public class StaticConstantsTest {
2
3     public static int MAX = 10;
4     public int x = 10;
5
6     {
7         System.out.println("hi");
8     }
9
10     static {
11         System.out.println();
12     }
13     
14     public StaticConstantsTest() {
15         System.out.println(x);
16     }
17     
18     public StaticConstantsTest(int i) {
19         System.out.println(i*x);
20     }
21     
22     public static void main (String JavaDoc [] args) {
23         StaticConstantsTest sct = new StaticConstantsTest();
24         sct.run();
25     }
26
27     public void run() {
28     
29         int [] arr = new int[MAX];
30         int i = x;
31         x = i * i;
32     }
33 }
34
Popular Tags