changes
[IRC.git] / Robust / src / Tests / Prefetch / ArrayTest.java
1 public class ArrayTest {
2     Item x;     
3     public ArrayTest() {
4     }
5     
6     public static void main(String[] args) {
7         ArrayTest[] n=new ArrayTest[10];
8         for(int i=0;i<10;i++) {
9             n[i]=new ArrayTest();       
10             n[i].x=new Item();
11             n[i].x.i=new Integer(10);
12         }
13         addItems(n);
14     }
15     
16     public static int addItems(ArrayTest [] array) {
17         int sum=0;
18         for(int i=0;i<array.length;i++) {
19             ArrayTest a=array[i];
20             int x=a.x.i.intValue();
21             if (x%2==0) {
22                 sum=sum+a.x.i.intValue();
23             }
24         }
25         return sum;
26     }
27 }
28
29 public class Item {
30     Integer i;
31     public Item() {
32         
33     }
34
35 }