title: Java Linked List lookup framework
body: <p>I have two JAVA classes User and Users. Users is the main class which will list the instances of the User Class in a Linked List. user should be able to add and delete users. My coe is not doing the deleting.</p>
  
  <pre><code>import java.util.*;
  public class Users {
  
  // Main method
  public static void main(String[] args) {
      new Users();
  }
  //attributes
  private LinkedList&lt;User&gt; users = new LinkedList&lt;User&gt;();
  
  //Constructors
  public Users(){
      add();
      add(); 
  }
  
  //Methods
  
  //adds a user to the list
  private void add(){
      users.add(new User());
  }
  //deletes a user from the list
  private void delete(){
      User user = user(readName());
      if (user != null)
          users.remove(user);
      else
          System.out.println("    No such user");
  }
   //returns the user if the user exists in the list
  private User user(String name){
      for (User user: users)
          if (user.matches(name)){
              return user;
          }
      return null;
  
  }
  private String readName(){
      System.out.print("  Names: ");
      return In.nextLine();
  }
  
  }
  
  
  User class
  
  public class User {
  
  //Attributes
  private String name;
  private Users users;
  
  //Constructors
  public User(){
      this.name = readName();
  }
  
  //Methods
  //checks if the parameter is equal to the name field
  public boolean matches(String name){
      return this.name == name;
  }
  public void add(){
      System.out.print(" " + name);
  }
  public void delete(){
  
  }
  public String readName(){
      System.out.print("  Name: ");
      return In.nextLine();
  }
  
  }
  </code></pre>
  
  <p>In the Users class the <code>user(String s)</code> method is not delivering the element, even if it was added to the list. 
  please some advices</p>