title: Java Stack Linked list
body: <p>I have declared a Queue of objects Node with the following lines of code:</p>
  
  <pre><code>Queue&lt;Node&gt; queue;
  queue = new LinkedList&lt;Node&gt;();
  </code></pre>
  
  <p>However, when I declare a stack of the Node objects, by replacing the Queue with stack, it doesn't work. Why is it so? Also, what exactly does </p>
  
  <pre><code>queue = new LinkedList&lt;Node&gt;(); 
  </code></pre>
  
  <p>mean? Does it mean that a linked list of Node objects is being created and can be in the Queue?</p>
  
  <p>I am taking open courseware to learn about Data Structures and Algorithms and I am a beginner. Thanks!</p>