我在其中一个教程中看到了这段代码.它没有任何错误,但我只是不理解代码.有人可以指导我吗?
int trying[] = {3,4,5,6,7};
change (trying);
for(int y: trying) {
System.out.println(y);
}
}
public static void change (int x[]) {
for ( int counter = 0; counter < x.length ; counter++){
x[counter] += 5;
}
}
Run Code Online (Sandbox Code Playgroud)
能为我解释这部分吗?
for(int y: trying) {
System.out.println(y);
}
Run Code Online (Sandbox Code Playgroud)
我不明白这行代码:
for(int y:trying)