title: How to reverse a stack in java using another stack?
body: <p>I want to reverse a stack in java of the form <code>java.util.Stack</code> by using another stack. I know i can just push the top most element of <code>stack 1</code> to <code>stack 2</code> and <code>stack 2</code> will have reversed elements of <code>stack 1</code>. But the question requires me to reflect the answer in <code>stack 1</code> itself and not <code>stack 2</code>. Also i cannot use any more stacks. How to reverse and reflect the reversed answer in <code>stack 1</code> itself ?</p>