首页 > 试题广场 >

设有数组定义: int a[] = { 10 , 50 ,

[填空题]

设有数组定义: int a[] = { 10 , 50 , 30 , 40 , 80 , 60 , 20 , 30 , 90 , 20 };

将输出结果填写在输出语句后的注释中。

public int get ( int score[]){

m =score[0];

for ( int i = 0;i < score. length ;i++){

if ( m < score[i]){

m = score[i];

}

}

return m ;

}

a[] 带入 get 方法后, m 取值为 1
方法的目的是找出最大值 因此 return 90
发表于 2017-05-22 10:06:59 回复(0)