title: Stack in Java not being able to print in specific order
body: <p>Currently I'm working on a project that is supposed to be a reverse word guessing game. <br />
  <br />
  This is how it should work:</p>
  <pre><code>Enter a word: (input = cheese)
  </code></pre>
  <pre><code>Your word is: _ _ _ _ _ e
  What letter do you guess? (input = s)
  </code></pre>
  <p>The use keeps guessing the word until it is fully spelled out. If the user guesses the letter correctly it is revealed if not it is still reveled as shown below</p>
  <pre><code>Your word is: _ _ _ _ _ e
  What letter do you guess?
  </code></pre>
  <pre><code>Your word is: _ _ _ _ s e
  What letter do you guess?
  </code></pre>
  <pre><code>Your word is: _ _ _ e s e
  What letter do you guess?
  </code></pre>
  <pre><code>Your word is: _ _ e e s e
  What letter do you guess?
  </code></pre>
  <pre><code>Your word is: _ h e e s e
  What letter do you guess?
  </code></pre>
  <pre><code>Your word is: c h e e s e
  Gameover!
  </code></pre>
  <p>⚠️ Currently I have a stack containing all the letters of the given word as shown below:⚠️   <br />
  Bottom:   c h e e s e      :Top</p>
  <p>I currently have this code:</p>
  <pre class="lang-java prettyprint-override"><code>while(guesses &lt; letters.size()){
     System.out.print(&quot;Your word is: &quot;);
     for(int i = 1; i &lt; letters.size(); i++){
        System.out.print(&quot;_ &quot;);
     }
     System.out.println(letters.peek() + test);
     System.out.println(&quot;Score: &quot; + score);
     System.out.print(&quot;What letter do you guess? &quot;);
     char guess = sc.next().charAt(0);
     if((Object)guess == letters.peek()){
        test += letters.pop();
        score++;
     }
     else{
        test += letters.pop();
        score--;
     }
  }
  </code></pre>
  <p>However it is printing this:</p>
  <pre><code>Your word is: _ _ _ _ _ e
  Score: 0
  What letter do you guess? 
  Your word is: _ _ _ _ se
  Score: 0
  What letter do you guess? 
  Your word is: _ _ _ ees
  Score: 0
  What letter do you guess? 
  Your word is: _ _ eese
  Score: 0
  What letter do you guess? 
  Your word is: _ hesee
  Score: 0
  What letter do you guess? 
  Your word is: ceseeh
  Score: 0
  Gameover!
  </code></pre>
  <p>Thank you. If any more information is needed please comment and tell me!</p>