Helo, im new to java and want to ask a question. My task is to make a massive and then sort 0 column of this massive, how should i change my code?
Java:
import java.util.Arrays;
public class ClassTask {
public static void main(String[] args) {
int n = 4; // rows
int m = 56; // columns
int a = 0; // min
int b = 6; // max
int[][] mas = new int[n][m];
for (int i = 0; i < mas.length; i++) {
for (int j = 0; j < mas.length; j++) {
mas[j] = (int)(Math.random() * (1 + b - a) + a);
System.out.printf("%2d", mas[j]);
}
System.out.println();
for (int i = 0; i < mas.length; i++) {
Arrays.sort(mas);
System.out.print(mas[0] + " ");
}
}
}
}