1 public class test2 { 2 /** 3 * 数组逆序输出 4 * @param args 5 */ 6 public static void main(String[] args) { 7 // TODO Auto-generated method stub 8 int a[] = new int [4]; 9 a[0] = 1; 10 a[1] = 2; 11 a[2] = 8; 12 a[3] = 7; 13 for (int i =a.length-1; i >=0; i--) { 14 15 System.out.println(a[i]); 16 } 17 } 18 19 }