Java parameter varargs

It's not bad syntax, it's Java's variadic argument

Variable parameters can be either no parameters (empty parameters), or can be of indeterminate length. Variable-length parameters are actually quite similar to array parameters. In fact, that's exactly what happened. The compiler will quietly convert the last parameter into an array parameter, and make a mark in the compiled class file, indicating that this is a method with variable number of actual parameters.

 

 Array class parameters and variadic parameters cannot be overloaded

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324870550&siteId=291194637