title: How can I call the Node class nested within my SLL class?
body: <p>Right now I have imported a Singly linked class in my Java program that contains a nested Node class as so: </p>
  
  <pre><code>public class SLList&lt;T&gt; extends AbstractQueue&lt;T&gt; {
  class Node {
      T x;
      Node next;
  }
  //
  //Some more code
  //
  }
  </code></pre>
  
  <p>I instantiated my SLList class as a generic</p>
  
  <pre><code>Queue&lt;Integer&gt; mySLL=new SLList&lt;Integer&gt;();
  </code></pre>
  
  <p>Specifically, now, I want to be able to take two nodes (in my case integers) and switch only the links of those nodes so that they switch places in the singly linked list. However, I cannot access the node when I try to instantiate it. So far, I've tried this:</p>
  
  <pre><code>SLList.Node myNode= mySLL.new Node();
  </code></pre>
  
  <p>But it says it cannot find Node(). Is there a way in which I can succefully call Node? 
  Cheers</p>