import java.util.*; public class A5 { /** Constructs a random square matrix of nonnegative integers of a given size, with zeros down the main diagonal and no zeroes elsewhere. @param s the desired size of the matrix @param maxValue the largest acceptable entry value @param r a Random object for the construction of random entries */ // The matrix is constructed in row major order by consulting // the Random object, skipping entries on the main diagonal. public static Integer[][] buildRandomIntegerArray(int s, int maxValue, Random r) { Integer[][] entry = new Integer[s][s]; for (int i=0; i