This will not compile:
public class Methods
{
public static void method(Integer... i)
{
System.out.print(\"A\");
}
public static vo
Multiple arguments must be passed in an array, but the varargs
hides the process. In the above varargs
method, parameter acts as an int
array with a reference name.
So if you change it to:
public static void main(String args[])
{
int[] s = {7};
method(s);
}
first class will compile and work properly.