title: Java basics for ques
body: <p><strong>QUESTION</strong>
  How come this code here:
  <code>Object y=x.remove();</code> removes the object from the queue?
  Isn't this just a variable assignment. Why does it run the code, when we are not calling it? Does variable deceleration call the methods as well? </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>Queue&lt;Integer&gt; x = new LinkedList&lt;Integer&gt;();
      x.add(5);
      x.add(7)
      Object y=x.remove(); //&lt;------THIS
      x.add(4)
      System.out.println(x.element());</code></pre>
  </div>
  </div>
  </p>