下列程序中定义了一个长度为20的整数数组,然后将1~20分别赋给数组元素,计算该数组中所有元素的和。
public class exam_1{
public static void main(String args[]){
int sum;
______;
int arrayList[]=new int[20];
for(int i=0; i<=19; i++)
arrayList[i]=i+1;
int pos=0;
while(pos<20){
if(______)
sum=sum+arrayList[pos];
______;
}
System.out.println("sum="+sum);
}
}