I have an ArrayList<Integer> that is full of years that it pulls from my database i want to know how it is possible to loop through them so i can remove duplicates.
Thanks in Advance,
Dean
I have an ArrayList<Integer> that is full of years that it pulls from my
Share
Use a
Setinstead of aListif duplicates shouldn’t exist.You can either use a
Setwhere you’re currently using yourList, or you can use theSetto remove duplicate elements.Or you could transform from one collection to another. I’m not sure what performance implications there are: