KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ArrayAssigns


1 public class ArrayAssigns {
2
3     public static void main(String JavaDoc [] args){
4         int [] arr = new int [] {1, 2, 3};
5         int i = 0;
6         
7         D d = new D(9);
8         arr[i++] += d.height;
9         arr[i++] += d.height;
10         //S s = new S(8);
11
//D d = new D(9);
12

13         //s.height += d.height;
14

15     }
16 }
17 class S {
18     int height;
19     public S(int i){
20         height = i;
21     }
22 }
23 class D {
24     int height;
25     public D(int i){
26         height = i;
27     }
28 }
29
Popular Tags