Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Question on removing duplicate data in a collection

816802Sep 12 2018 — edited Oct 21 2018

Hi All,

I have the below employee class defined.

public class Employee implements Comparable<Employee> {

private int id;

private String name;

private String salary;

private String recordStatus;

private int key;

public Employee(int id, String name, String salary, int key) {

super();

this.id = id;

this.name = name;

this.salary = salary;

this.key = key;

}}

Now I have a list of type Employee.

List<Employee> list = new ArrayList<Employee>();

list.add(new Employee(123, "zMadhu", "1000$",1));

list.add(new Employee(332, "bSudhan", "2000$",2));

list.add(new Employee(54, "cKongarass", "3000$",3));

list.add(new Employee(54, "xKongarass", "3000$",4));

list.add(new Employee(54, "aKongarass", "3000$",5));

Now I want to remove data from this list and have only unique IDS. I.E. I am expecting 54,123,332.

Want to see how I can do it. Much appreciate your help here.

Comments

Levi Pereira
Windows XP is not a little old?

Have you tried to search on Google ASM + Windows XP + Install ...

I am absolutely sure you would find this link:
http://www.databasejournal.com/features/oracle/article.php/3571371/Oracle-10g-Automatic-Storage-Management-ASM-Part-2-Sample-Implementation.htm

Always use documentation or Google It.

Regards,
Levi Pereira
585179
Hi,

Have a read note "How To Setup ASM (10.2) on Windows Platforms [ID 469082.1]" or "How to setup ASM on Windows [ID 331796.1]"


Cheers
1 - 2

Post Details

Added on Sep 12 2018
2 comments
228 views