此方法应该采用2行乘3列数组m
,对其进行排序并输出已排序的数组
import java.util.Arrays;
public class Foo {
public static void main(String[] args) {
int[][] m1 = { { 14, 11, 13, 12 },
{ 18, 15, 13, 13 },
{ 19, 16, 15, 17 } };
sortRows(m1);
}
public static int[][] sortRows(int[][] m) {
int sorted[][] = new int[2][3];
for (int i = 0; i <= 2; i++) {
sorted[i] = Arrays.sort( m[i] ); //ERROR- cannot convert from void to int
}
return sorted;
}
}
我无法想象虚空将来自哪里。这甚至意味着什么?