int rows = matrix.length
and int columns = matrix[0].length
. Once you have the row / column dimensions, write 2 for loops that traverse the entire matrix. In the inner for loop, use a temporary variable to make the swap.
...
for(int i = 0; i <= r/2; i++){
for(int j = 0; j <= c; j++){
...
(swap)
...
}
}
public static void flipHorizontalAxis(int[][] matrix) { }
C
Java
Python