title: POP method linked list
body: <p>I've implemented a pop method in Java I would use it for delimiter matching, though it leaves one element in the list.</p>
  
  <pre><code>    public int length(){
      Node current = this.head;
      int length = 0;
          while(current != null){
              current = current.getNextNode();
              length += 1;
          }
      return length;
  }
  
  public char pop(){
      Node current = this.head;
      Node lastN = this.last;
  
      for(int i = 0; i &lt; length() - 2; i++){
          current = current.getNextNode();
      }
      current.setNextNode(null);
      this.last = current;
  
      return lastN.getBracket();
  }
  </code></pre>
  
  <p>How do I pop the first element if length is >= 1?, or any suggestion for improving my code.</p>