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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post by answerhappygod »

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 */; } }
}
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply