Question: Language: Java Complete the reverse() method which takes an array of integers as a parameter and returns a new array such that its elements are

Language: Java

Complete the reverse() method which takes an array of integers as a parameter and returns a new array such that its elements are the same as the parameter array except that they are in reverse order.

For example:

int[] numbers = {2,7,3};

System.out.println(Arrays.toString(reverse(numbers)));

Result: [3, 7, 2]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!