title: Error message 'Cannot be resolved or is not a field'
body: <p>Right now I'm studying the chain of responsibility design pattern and am using <a href="http://en.wikipedia.org/wiki/Eclipse_%28software%29" rel="nofollow">Eclipse</a>.</p>
  
  <p>And I'm trying to compile this code, but I have the compiling error "isLast cannot be resolved or is not a field":</p>
  
  <pre><code>public class OverFive implements Discount {
      private Discount next; //
      public boolean isLast = false;
  
      public void setNext(Discount next, boolean Last) {
          this.next = next;
          this.next.isLast = Last; // Here is the error.
      }
  
      public double DoDiscount(Budget budget) {
          if (budget.getValue() &gt; 500) {
              return budget.getValue() * 0.10;
          }
          if (this.next.isLast == false) {
              return next.DoDiscount(budget);
          }
          else {
              return 0;
          }
      }
  }
  </code></pre>
  
  <p>And now, here is the interface:</p>
  
  <pre><code>public interface Discount {
  
      double DoDiscount(Orcamento orcamento);
          void setNext(Discount next, boolean Last);
      }
  </code></pre>