public class ChangeArgs_Exel {
public static void main(String[] args) {
Count04 c = new Count04();
int manNum=c.max(5,3,9,7,15);
System.out.println("最大值是:"+manNum);
}
}
class Count04{
public int max(int num,int...other){
int max=num;
for (int i=0;i<other.length;i++){
if (other[i]>max){
max=other[i];
}
}
return max;
}
}
可变参数02
最新推荐文章于 2024-09-05 10:39:00 发布