import test2.TestUtility; import java.io.PrintStream; import java.util.ArrayList; public class Test2GShort { public static void main(String[] args) { PrintStream out = System.out; // get and print a random list of integers final ArrayList LIST = TestUtility.randomList(); out.println(LIST); // the number of elements in a row final int N = 9; /* All that is needed is a loop to compute the sum of the N elements. */ int sum = 0; for (int i = 0; i < N; i++) { sum += LIST.get(i); } out.println(sum); } }