Question: This is in Java Write a method that takes a 2D array and reverses all of the content in the 2D array. The last value


This is in Java
Write a method that takes a 2D array and reverses all of the content in the 2D array. The last value should be the first, and the first value should be the last. For example, the call reverse({{1,2,3},{4,5,6},{7,8,9}}) would return: [9,8,7] [6,5,4] [3,2,1] M iii 1 public static int[][] reverse(int[][] arr) 2-{ 3 4 } 5 FILES Scratchpad.java Unit Test M iii FILES 1- /* This is the Scratchpad! 2 This file is not graded, but you can use it to test your code. 3 4 You can write and test your method in the Scratchpad, but make 5 sure to copy and paste it into the Unit Test file before check 6 your answer. Remember to only copy and paste the method you wa 7 to submit, not all of your tests. Scratchpad.java Unit Test 9 12 10 public class Scratchpad 11- { public static void main(String[] args) 13- { // Add your own tests here } 16 // Copy and paste your Unit Test method here 18 ] 14 15 17 19
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
