I code in Python normally, this error makes no sense to me. I can't fathom what I could be doing wrong here. I checked out similar threads with same error message to no avail.
I think this error has something to do with the same classes and methods are called in Java. Tried switching around the way method is called but didn't do it. Any ideas?
public class test2 {
public int[] makeMiddle(int[] nums){
int[] l1 = {nums[(nums.length/2)-1], nums[(nums.length/2)]};
return l1;
}
public static void main(String[] args){
makeMiddle({1,2,3,4});
makeMiddle({5,6,2,1,7,6,3,4,0,1});
}
}