Why isn\'t the implementation of Math.max a variadic function?
It could get implemented like this:
public class Main {
public static double max(d
because its been there for longer than variadic functions exist in java (introduced in java 5) and there wasnt much demand to update it since, as you've just shown, its trivial to do yourself.
also, there' s ahidden performance penalty involved in varargs methods as an array (double[]) will be created from your arguments behind the scenes