if you want to compare objects should have something like this, complete answer here here !here !
public boolean equals(Object object2) { return object2 instanceof MyClass && a.equals(((MyClass)object2).a); } or could compare for any specific field of its objects for example
if(peopleDirectory.get(i).getFirstName().equals(thePerson.getFirstName())) *no need to send a parameter a new Person () could work with a single object class level and only modify their attributes with its setter when you want to perform some operation
nor declare as many Scanner objects if you can work with one for example *
static Scanner userInput = new Scanner(System.in); to work with a single object could be something
static Person person = new Person();//declaration and its method add or remove when requesting data entry setteas object attributes created and comparison also perform based on that object
System.out.println("Enter the first name of the Person you would like to add: "); person.setFirstName(userInput.nextLine());//data entry and setteo if (peopleDirectory.get(i).equals(person)) // comparation