118k views
1 vote
JAVA

Write a method that takes an int array and returns a reversed version of the array.

For example:

reverse(new int[]{1, 2, 3})
Should return an array with the values:

[3, 2, 1]

public int[] reverse(int[] arr)
{
}

1 Answer

2 votes

Answer:

Code provided in the attached screenshot.

Step-by-step explanation:

JAVA Write a method that takes an int array and returns a reversed version of the-example-1
User GyRo
by
4.5k points