public class Demo03 {标签:找出,arrays,max,最大值,System,int,数组,println,out From: https://www.cnblogs.com/123456dh/p/17095103.html
public static void main(String[] args) {
int[] arrays={1,2,3,4,5,6};
for (int i = 0; i <arrays.length ; i++) {
System.out.println(arrays[i]);
}
System.out.println("=================");
//找出数组中的数的最大值
int max=arrays[0];
for (int i = 0; i <arrays.length ; i++) {
if(arrays[i]>max){
max=arrays[i];
}
}
System.out.println("max="+max);
}
}