I am trying to print out a simple code but I do not seem to be able to pass the array variable of the method. Sorry if it is something obvious, I am only starting with Java. I am getting the "The method asd in the type MyClass is not applicable for the arguments (int,int,int,int)
public int asd(int[] nums) {
int count = 0;
// Note: iterate to length-1, so can use i+1 in the loop
for (int i=0; i < (nums.length-1); i++) {
if (nums[i] == 6) {
if (nums[i+1] == 6 || nums[i+1] == 7) {
count++;
}
}
}
return count;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println(asd(1,22,3,4,2,2,2));
}

public int asd(int... nums) {The ... can only be on the last argument in a method declaration as it collects all arguments after that one into an array.