6.7.5: Write a method that reverses the order of theelements in an array.
Write a method reverse that takes an array as anargument and reverses it. Do not createa new array. Modify the array parameter.
Must be in Java
Given Code:
public class ArrayUtils{ /** * Reverses the order of the elements in anarray. * @param words an array of String to reverse. */
public static /* Your code goes here */reverse(String[] words) { for (int i = 0; i < words.length;i++) { /* Your code goes here */; } }
}
6.7.5: Write a method that reverses the order of the elements in an array. Write a method reverse that takes an array as
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am