title: Way of implementing LinkedList, Java
body: <p>I'm reading this book and there is this chapter on liked list and it starts with the implementation of a single linked list, it goes like this:</p>
  
  <p>Creating a Linked List:</p>
  
  <pre><code>class Node {
      Node next = null;
      int data;
  
      public Node(int d) {
          data = d;
      }
  
      void appendToTail(int d) {
          Node end = new Node(d);
          Node n = this;
          while (n.next != null) {
              n = n.next;
          }
          n.next = end;
      }
  }
  </code></pre>
  
  <p>My questions:</p>
  
  <p>First: I can't understand how this works. Is this really that complex to understad it or I'm missing something?</p>
  
  <p>Second: Can this "Node" class be considered a linked list? I know it's missing some functionality but is this a linked list on it's own?</p>
  
  <p>Third: I've googled LinkedList implementations in java and glanced at the original class in java api and it's a totally different approach. To what approach should I stick?</p>