package array; import javax.swing.*; //计算数组元素之和 publicclass SumArray ...{ publicstaticvoid main(String args[])...{ int array[] =...{1,2,3,4,5,6,7,8,9,10}; int total =0; for(int counter=0; counter<array.length;counter++)...{ total += array[counter]; JOptionPane.showMessageDialog(null, "Total of array elements:"+total,"Sum the Elements of an Arrays",JOptionPane.INFORMATION_MESSAGE); System.exit(0); } } }