Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How to remove duplicates elements from ArrayList in Java?

user-image
Question added by Mohammad Abrar Abrar , Team Leader , Enkindle Technologies Pvt Ltd
Date Posted: 2016/06/13
AbdulHamid Rashankar
by AbdulHamid Rashankar , System Engineer , TATA Consultancy Servies

Simply iterate List by exah element store each element in Set.

i.e.Convert list to set

Set doesn't store duplicate elements.

Abdullah al-rahahleah
by Abdullah al-rahahleah , Java Developer , EtQ

The easiest way is to use nested for loop, but you can take an element for example a[0] then use contains function in smart way then you do that in smart way

More Questions Like This