public class Demo5 {
public int FindMax(int a,int...nums){
int max = a;
for (int i = 0; i < nums.length; i++) {
if (nums[i]>max){
max=nums[i];
}
}
return max;
}
public static void main(String[] args) {
Demo5 demo5 = new Demo5();
System.out.println(demo5.FindMax(1,23,12,32,3,100,9,12));
}
}
运行结果: