Why isn't Math.max(double a, double b) variadic?

前端 未结 6 956
逝去的感伤
逝去的感伤 2021-01-12 23:33

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         


        
6条回答
  •  难免孤独
    2021-01-13 00:08

    Math.max() dates back to JDK 1.0, whereas variadic functions have not existed until Java 5.

提交回复
热议问题