📜  带有 for 循环的数组 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:12.597000             🧑  作者: Mango

代码示例10
// For-All variant
// Go through the elements backwards
// by adjusting the for-loop
public void forAllBackwards(int[] nums) {
  for (int i = nums.length-1; i>=0; i--) {
    System.out.println( nums[i] );
  }
}