Here you can find the source of randomMatrix(int x, int y)
public static int[][] randomMatrix(int x, int y)
//package com.java2s; //License from project: Open Source License public class Main { public static int[][] randomMatrix(int x, int y) { int[][] matrix = new int[x][y]; for (int i = 0; i < matrix.length; i++) { for (int j = 0; j < matrix[0].length; j++) { matrix[i][j] = (int) (Math.random() * 10); }/*from w w w . j a va2 s.co m*/ } return matrix; } }