This is my first post so please excuse me if I've made any errors.
In this program I've written, the user inputs integers one at a time from the keyboard, 2 4 5 1 3 for example. The reverse method if called before any of the others would return 3 1 5 4 2. However, if the sort method is called, giving us 1 2 3 4 5, then the reverse method is called, we get 5 4 3 2 1. Any ideas how to get the reverse to return the reverse order of the original input even after the other methods have been called?
public static void reverse(ArrayList<Integer> num) {
ArrayList<Integer> newNum= new ArrayList<Integer>();
newNum = num;
Collections.reverse(newNum);
System.out.println(newNum);
}