输出数组元素的minValue

public class TestDemo1{
public static int maxValue(int[]array){
int min=array[0];
for (int i = 1; i if (min>array[i]){
min=array[i];
}
}return min;
}
public static void main(String[] args) {
int[]array={41,54,78,1,5};
int a=maxValue(array);
System.out.println(a);
}
}

你可能感兴趣的:(java)