Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
maxvalue 2d arraylist java_Java_Arraylist_Max - Fatal编程技术网

maxvalue 2d arraylist java

maxvalue 2d arraylist java,java,arraylist,max,Java,Arraylist,Max,我有: 要在行中获得最大值,这相当容易,而且您的方法是正确的 int aMaxR1, aMaxR2, aMaxR3; int aMinC1, aMinC2, aMinC3; aMaxR1 = Collections.min(group.get(here could be first row)); aMaxR2 = Collections.min(group.get(here could be second row)); aMaxR3 = Collections.min(group.get(he

我有:


要在行中获得最大值,这相当容易,而且您的方法是正确的

int aMaxR1, aMaxR2, aMaxR3;
int aMinC1, aMinC2, aMinC3;

aMaxR1 = Collections.min(group.get(here could be first row));
aMaxR2 = Collections.min(group.get(here could be second row));
aMaxR3 = Collections.min(group.get(here could be third row));

aMaxC1 = Collections.max(group.get(here could be first column));
aMaxC2 = Collections.max(group.get(here could be second column));
aMaxC3 = Collections.max(group.get(here could be third column));
对于列,可以执行For循环:

aMaxR1 = Collections.max(group.get(0));
aMaxR1 = Collections.max(group.get(0));
 for(int i = 0; i < group.size(); i++){
     System.out.println(Math.max(Math.max(group.get(0).get(i), group.get(1).get(i)), group.get(2).get(i)));
  }
7
8
9