title: How easy is it to steal something left out for garbage collection?
body: <blockquote>
    <p><a href="https://stackoverflow.com/q/10443308/2408342">Why <code>getText()</code> in JPasswordField was deprecated?</a></p>
  </blockquote>
  
  <p>According to <a href="https://stackoverflow.com/a/10443361/2408342">this answer</a> for the above question, what I understood was that creating a <code>String</code> object containing the password is a <strong>security threat because it may remain in the memory for a while</strong> and it is immutable.</p>
  
  <p>So I was wondering,</p>
  
  <ul>
  <li><p>How easy is it to <strong>retrieve something which has been hanging around
  in the memory</strong>, without a reference or left out for garbage collection?</p></li>
  <li><p>And how do you do it?</p></li>
  </ul>
  
  <hr>
  
  <p><strong>EDIT</strong></p>
  
  <p>As the question has been closed, be kind to share your knowledge by adding a comment, and consider reopening the question if you believe it may get interesting answers in the future. :)</p>