The problem is that your foo method requires an int array and that is not what you are passing it. Arrays in java are objects, so you need to create one to send. It looks to me like neither invocation will work. All objects, except Strings, need to be explicitly created with the new keyword.
public class IllegalStartOfExpression{
public static void main(
String [] args){
int[] x = new int[]{1, 2};
foo(x);
foo(new int[]{1, 2});
}
public static void foo(int[] x){
System.out.println(x[0]);
}
}
------------------
Brian Hoff
Sun Certified Programmer for the Java� 2 Platform