No method signature (included constructors) allows multiple varargs. There can only be one, and it should be the last argument.
This is just a limitation in the language specification. And yes, the reason for this is that it can become very ambiguous very quickly if you allow more flexibility.
There is no such restriction in the builder pattern, since each parameter can get its own method.
builder
.withOptions("a", "b", "c")
.withColors("red", "blue")
.build();
source
share