Why isn't Math.max(double a, double b) variadic?
问题 Why isn't the implementation of Math.max a variadic function? It could get implemented like this: public class Main { public static double max(double... values) { double max = Double.NEGATIVE_INFINITY; for (double tmp : values) { max = max < tmp ? tmp : max; } return max; } public static void main(String[] args) { // This works fine: System.out.println(max(-13, 12, 1337, 9)); // This doesn't work: // System.out.println(Math.max(-13, 12, 1337)); } } Is there any reason why it is not