how do I reverse a stack using another stack in java [closed]
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . Hi I am trying to reverse a stack(one I coded myself) using another empty stack. For some reason it is not working properly. Can anyone help me with this ? public static void main(String[] args) { Stack stack1 = new Stack(); //filling the stack with numbers from 0 to 4 for(int i = 0; i < Constants.MAX_ELMNTS; i+