class ArrayDome 
{
    public static void main(String[] args) 
    {
        int[] arr = {12,51,12,11}; 
        //顺序遍历
        for(int x = 0; x < arr.length; x++)
        {
            System.out.println(arr[x]);
        }
        //反向遍历
        for(int x = arr.length-1; x >= 0; x--)
        {
            System.out.println(arr[x]);
        }
    }
}
原文:https://www.cnblogs.com/150643com/p/10357217.html