This is my code:
//VariableArguments1.java
public class VariableArguments1
{
static void test(int ...v)
{
System.out.println("length:"+v.length);
for(int x:v)
{
System.out.println("x="+x);
}
}
}
and
//VariableArguments1Test.java
public class VariableArguments1Test
{
public static void main(String args[])
{
test(33,43,34,23,24);
test(43,442);
test();
}
}
Following are the errors i am getting:
VariableArguments1Test.java:5: cannot find symbol
symbol : method test(int,int,int,int,int)
location: class VariableArguments1Test
test(33,43,34,23,24);
^
VariableArguments1Test.java:6: cannot find symbol
symbol : method test(int,int)
location: class VariableArguments1Test
test(43,442);
^
VariableArguments1Test.java:7: cannot find symbol
symbol : method test()
location: class VariableArguments1Test
test();
^
I am not able to figure out what's wrong here.