1. public static void arrayLoopRefactoring()
2. {
3. int[] myArray = {1 , 2 , 3 , 4} ;
4. for(int x = 0 ; x < myArray.length ; x++) {
5. System.out.println(myArray[x]) ;
6. }
7. }
1. public static void arrayLoopRefactoring()
2. {
3. int[] myArray = {1 , 2 , 3 , 4} ;
4. for(int item : myArray) {
5. System.out.println(item) ;
6. }
7. }
进入讨论组讨论。 新闻热点
疑难解答