Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

1
  • 2
    Look at what happens when you do a System.out.println(studentList.remove(new Student("A"))). This will not remove student1 from the list despite having the same name (which may or may not be the desired effect). If you'd want to construct multiple instances of the same student and use a collection with any of these instances, you'd have to override equals() and hashCode() Commented Aug 20, 2012 at 12:13