📜  返回数组中最大值的索引的java函数 - Java代码示例

📅  最后修改于: 2022-03-11 14:52:19.864000             🧑  作者: Mango

代码示例2
int largest = 0;
for ( int i = 1; i < array. length; i++ )
{
if ( array[i] > array[largest] ) largest = i;
}
return largest; // position of the first largest found.
}