title: Searching in linked list with scanner in java
body: <p>I want to search in linked list with scanner but i cannot do it. I can search without scanner. What is wrong with this code?</p>
  
  <p>My search method:</p>
  
  <pre><code>    public void Search(Object data){
      Node tmp = head ;
      while(tmp != null ){
  
          if(tmp.getData() == data){
              System.out.println("Your input is in the list");
          }
  
              tmp = tmp.getNext();
  
  
      }
  
  }
  </code></pre>
  
  <p>And my main class:</p>
  
  <pre><code>  public static void main(String[] args) throws ParseException {
      LinkedList list =new Linkedlist();
      ...... // adding methods etc.
      Scanner input = new Scanner(System.in);
      System.out.println("Enter your input: ");
      String x=input.next();
      list.Search(x);
  }
  </code></pre>