-3
有人可以解釋初始化部分在做什麼嗎?以及循環如何結束?for循環初始化
The for loop generally I see is
for(int i =0; i<5; i++){
}
but the following one is
int[][] xx = { {-1,0}, {0,1},{1,0},{0,-1}};
for(int[] y : xx){
int i = y[0];
int j = y[1];
System.out.println(i+" "+j);
}
閱讀[增強語句](http://docs.oracle.com/javase/tutorial/java/nutsandbolts/for.html)的時間。 –
這是一個可以理解的問題。畢竟,它並不像解釋Java功能如何工作和包含示例的無處不在的文檔。哦,等等... – 2013-02-08 06:09:45
答案是您在Google中輸入「Colon in for loop,Java」時的第一個鏈接。在索取SO之前做一些研究。否則,你只是在浪費每個人的時間。 – SecurityMatt