write a program to reverse an array in java