The reason you get this output is because you are calling the toString() method on the iterator and not on the Student object.
You can remove Student from the list using
school.remove(student);
Also, if you want to print meaningful information about the Student object when writing
System.out.println(student);
Override the toString() method for it, because the System.out.println() statement will internally call toString() on the Student object.
public String toString() { return "Student [id=" + id + ", firstName=" + firstName + ", lastName=" + lastName + "]"; }
source share