1
Fork 0
mini-java/miniJava/tests/pa3_tests/pass349.java

25 lines
394 B
Java
Raw Normal View History

2014-04-08 00:06:13 +00:00
/**
* COMP 520
* Array update
*/
class MainClass {
public static void main (String [] args) {
int tstvar = 0;
int aa_length = 4;
int [] aa = new int [aa_length];
int i = 0;
i = 1;
aa[0] = i;
while (i < aa_length) {
aa[i] = aa[i-1] + i;
i = i + 1;
}
tstvar = aa[3] + 2;
System.out.println(tstvar);
}
}