// Use synchronize to control access. class SumArray { private int sum; synchronized int sumArray(int nums[]) { sum = 0; // reset sum for(int i=0; i