title: enqueue a linked list - java
body: <p>For an assignment (thats due pretty soon), I have to enqueue a linked list that I have implemented by hand (not using java's built in class). The linked list is as follows:</p>
  
  <pre><code>public class SnocList {
      private char c;
      private SnocList l;
  
      public SnocList(){
      }
      public SnocList (char x, SnocList y) {
          this.c = x;
          this.l = y;
      }
      public char getC(){
          return this.c;
      }
      public SnocList getL(){
          return this.l;
      }
      public void setNext(SnocList input){
          this.l = input;
      }
  
      public boolean isEmpty() {
          if (this.c == 0) return true;
          return false;
      }
  }
  </code></pre>
  
  <p>my Queue class is as follows:</p>
  
  <pre><code>public class SnocQueue {
      private SnocList list;
  
      public SnocQueue(){
          this.list = new SnocList();
      }
  
      public void enqueue(char c){
          //I don't know what to put here
      }
  }
  </code></pre>
  
  <p>I have no idea how to do this. It's apparently pretty simple but I don't know how to do it. for those of you that want to help, enqueue will add a new node to the list where the null reference (null pointer) of the previous list was.</p>
  
  <p>[ 'a' | --]-->[ 'b' | --]-->[ 'c' | null ]     add new node here</p>