Source:
public class TestVarArgs {
public void varArgsMethod(Object ... arr) {
System.out.println(arr.getClass().getName());
for(Object o : arr)
The argument of type String[] should explicitly be cast to Object[] for the invocation of the varargs method varArgsMethod(Object...) from type TestVarArgs. It could alternatively be cast to Object for a varargs invocation
You can fix it by doing either one of the way
If you cast the String[] to Object[] (ref:tva.varArgsMethod((Object[])args);)
OR
change the parameter of method to String[]
(ref:public void varArgsMethod(String ... paramArr))