title: Does a node contain this value? boolean contains(double val) method
body: <p>I'am trying to make this boolean method return true/false if any node in a list contains the value the user inputs.
  Everything compiles but when I run the method in the test class, it crashes.Any ideas?</p>
  
  <pre><code>public boolean contains(double info)
  {
    Node t = root;
    int count = 0;
    while(t != null)
    {
       if(t.val == info)
       {
          count++;
          t = t.next;
       }
    }
    if(count &gt; 0)
    {
       return true;
    }
    return false;
  }
  
  public class Tester
  {
       public static void main(String[] args)
       {
              LinkedList list = new LinkedList();   
              System.out.println( list );
  
              list.add(100);
              list.add(104);
              list.add(108);
              list.add(107);
              System.out.println( list );
              System.out.println(" The size of the list is: " + list.size() );
              System.out.println( list );
  
              System.out.print(list.contains(102));
    }
  }
  </code></pre>