#6 - How to Remove Duplicate Elements from an ArrayList using LinkedHashSet & JDK8 Streams

preview_player
Показать описание
#JavaCollectionFramework #ArrayList #NaveenAutomationLabs
In this video, I have explained, How to Remove Duplicate Elements from an ArrayList using LinkedHashSet & JDK8 Streams.

~~~Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:

Follow me on my Facebook Page:

Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram:

Paid courses (Recorded) videos:

Рекомендации по теме
Комментарии
Автор

Thank you for this video sir.
Looking forward for complete series.
I watched all videos from this series till now.

hiteshpachakawade
Автор

Informative! thanks for the video, Naveen!

vasanthjayakumar
Автор

Very informative video... It would be helpful if you could explain while making video about the scenarios where we can use these concepts in web testing...

swarnasharma
Автор

It's very easy Naveen sir clearly understandable wow

Thank You

jayeshkumar
Автор

Second method is more useful and kindof update to the market standards ✊🏼

tripurnachary
Автор

Full support, upload more please <3 thanks you so much sir

KaisarAnvar
Автор

both are very good approach and I have no doubt on that ..I applied this on both HashSet an LinkedHashSet and it works .The difference is only insertion order where LinkedHashSet preserve insertion order .but why you mention only LinkedHashSet why not both??? is there any other issue Mr Naveen ??thank you very much.

sourovrahman
Автор

Hello Naveen,

Thanks a lot for sharing your knowledge.

Just one query I have one.. any specific reason for choosing LinkedHashSet over HashSet, as this can be done using HashSet as well.

Kindly let me know..
Thanks in Advance!!

vijaykaushal
Автор

First of all super content . Learn something new everytime i start a playlist :)
I faced the same question in hacker rank . i used 2 for loops to iterate and remove the duplicate elements from the Integer arrayList, but the code could only pass 7 out of 10 data input scenarios . But if i use the any of 2 methods in video all 10 data input scenarios are passed . Could you please explain as to how using these 2 methods would handle any sort of input as compared to using regular for loops .

kunalbiswas
Автор

Thank you Naveen
If we print object of linkedhashset even then we are about to remove duplicate values. Why do we create new arraylist again ?

rishabagrawal
Автор

Sir here as we use LInkedHashSet on ArrayList
Should the order be maintained or not?

supteue
Автор

I have a query.
why use LinkedHashSet.
why not HashSet ? hashset has better performance in retrieving elements.
Any specific reason ?

doublehit
Автор

if i want to prinnt duplicates how to do that

TrickShotHeroes
Автор

do we have to use LinkedHashSet, or can we just use HashSet?

socialmedia
Автор

without creating arraylist after linkedhashset, we are geeting result in sysout.

maneeshbuddha
Автор

Hello Naveen.... In 1st approach we can also use HashSet right ..
The only purpose of using LinkedHashSet is to maintain output in ordered....right?
Or any other reason are there?

SameerKumar-yuxi
Автор

But why linkedhashset not only hashset can you explain pls?

priyotoshmaji
Автор

can you explain about passing parameters sir

ramasudha
Автор

Hi Brother, Just one query why can't we create an object of HashSet... I mean:
ArrayList<Integer> remduplicate = new ArrayList<Integer>(Arrays.asList(1, 2, 3, 4, 5, 1, 2, 3, 4));
Set<Integer> uniqset = new
ArrayList<Integer> uniqueArlist = new ArrayList<Integer>(uniqset);
System.out.println("Unique value in array list " + uniqueArlist);

Any specific reason to create an object of LinkedHashSet??

kapilrana
Автор

We can use hashmap . It's not better than these 2 ways but we can use that too.😀

blablagswjsvsns