suppose i have to add 3 student objects to array list in java. having some attributes.Attributes are name,id,age. Before inserting into array list i have to check uniqueness on name attribute.or u can say i have to remove duplicate names.can anybody suggest how to write the code to remove these duplicate attributes?
List<Student> list=new Array List<Student>();
list.add(new Student(21,"x",25));
list.add(new Student(21,"y",26));
list.add(new Student(22,"x",27));