public static void main(String[]args){
//this program is to print the index values of an array in reversed order using
//another array
int[]array1={5,6};
int[]array2= new int[2];
int i;
int j=1;
for(i=0;i<=1;i++){
array1[i]=array2[j];
j--;
}
for(int num: array1)
System.out.println(num);
}
I am not getting the output of array2 by reversing the index value of array1 and storing it in array2. Can anybody tell me the reason?
