Why doesn’t Java varargs support collections?
The reason is simple: a variable arity parameter is simply an old-school array paramater with some additional metadata that tells the compiler to provide some syntactic sugar (namely, it allows implicit array creation). So from the perspective of the JVM Object… is pretty much the same as Object[]. Allowing collections as well would require a … Read more