System.out.print doubt

why in direction 2 nd and 4th our i is coming before the left and right.
System.out.print(arr[i][right] + ", ");
System.out.print(arr[i][left] + ", ");

Hey @adityakathoch_a87e00c5c7e39b2d Bcoz i specifies row number for 2nd and 4th direction in spiral print.