What is wrong with the following code?
void m2(int...n1, String str) { // Code goes here }
The variable-length argument of a varargs method must be the last argument in the argument list.
m2() method is invalid because the variable-length argument n1 is not declared as the last argument:
You can fix the above declaration by moving argument n1 to the last, like so:
void m2(String str, int...n1) { // Code goes here }