标签:ring max gen number todo turn val generate i++
代码如下:
public class VarArgumentsDemo {
public static void main(String[] args) {
printMax();
}
private static void printMax(double... numbers) {
// TODO Auto-generated method stub
if (numbers.length == 0) {
System.out.println("No args");
return;
}
double result = numbers[0];
for (int i = 1; i < numbers.length; i++) {
if (numbers[i] > result) {
result = numbers[i];
}
}
System.out.println("Max value is " + result);
}
标签:ring max gen number todo turn val generate i++
原文地址:http://www.cnblogs.com/F001li/p/7055668.html