判断数组中找元素最大值
public static void main(String[] args) {
// 判断数组中找元素最大值
int[] Array = {23,12,45,24,10,60,30,2,1};
System.out.println(maxValue(Array));
}
public static int maxValue(int[]Array ){
int maxValue = Array[0];
for ( int e :Array){
if (Array.length == 1) return maxValue = e ;
if (e>maxValue) maxValue = e;
}
return maxValue;
}

浙公网安备 33010602011771号