title: I'm trying to count the value int in the java linked list Without success
body: <p>I've tried to count the numbers of int in linked list, but it's didn't work.
  I really glad to your help.</p>
  
  <pre><code>public class Node {                 
      public int  data;                 
      public Node next;                 
      public Node (int data, Node next) {
          this.data = data;               
      }  
  
      public Node (int data) {          
          this(data,null);                
      }                                 
  }
  
  public static int occurrences (int value, Node intNode) {
      int counter =0 ;
      for (int i = 0 ; i &lt; intNode.lenght ; i++)
      {
          if (i == intNode[i])
          {
               counter++
          }
          return counter;
      }
  }
  </code></pre>