Given:
 public class Bar {
 static void foo(int...x) {
 // insert code here
 }
 }
Which two code fragments, inserted independently at line 12, will allow
the class to compile? (Choose two.)
A. foreach(x) System.out.println(z);
B. for(int z : x) System.out.println(z);
C. while( x.hasNext()) System.out.println( x.next());
D. for( int i=0; i< x.length; i++ ) System.out.println(x[i]);哪位大侠帮我分析下四个选项。为什么对,为什么错?