public class test
{
public static void
main(String[] args)
{
int[] s = new int[10]{1,2,3,4,5,6,7,8,9,10};
for(int i:s)
{
System.out.println(i);
}
}
}
int[] s = new int[10]{1,2,3,4,5,6,7,8,9,10};這個寫法是不合理的,要麼int[] s = new int[]{1,2,3,4,5,6,7,8,9,10};要麼是int[] s = new int[10];