Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. public static void reverse(Object[] array) {
  2. Object[] arrayNew = new Object[array.length];
  3. for(int i = 0; i < arrayNew.length - 1; i++) {
  4. arrayNew[i] = array[array.length - i];
  5. }
  6. for(int i = 0; i < array.length; i++) {
  7. array[i] = arrayNew[i];
  8. }
  9. // Add code to reverse the order of the elements of the array
  10. // This method should work on any array that stores any type of object
  11. // (including but not limited to CreditAccount objects)
  12.  
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement