title: implement a queue using two stacks
body: <p>I think my codes are right, but i do not know why it is not adding elements onto the stack.
  Should i create other two stacks in the main?</p>
  
  <pre><code>import java.util.Stack;
  
  public class stacks {
      public Stack&lt;Integer&gt; in = new Stack&lt;Integer&gt;();
      public Stack&lt;Integer&gt; out = new Stack&lt;Integer&gt;();
  
      public void enqueue(int value){
           in.push(value);
      }
      public int dequeue(){
           if (out.isEmpty()){
              while(!in.isEmpty()){
                  out.push(in.pop());
              }
          }
          return out.pop();
      }
      public static void main(String[] args) {
  
  
          in.enqueue(10);
          in.enqueue(49);
  
  
      }
  
  }
  </code></pre>