filmov
tv
Java Collections - HashSet with equals and hashCode override | Java Tutorial Part 1 #022

Показать описание
In this Java Tutorial, you will learn about Java's Set Interface and HashSet Collection. Here, you will learn why one should override hashCode and equals method of the objects that participate in the HashSet (Any Hash-table based collection). You will also explore when HashSet calls equals and hashCode methods.
00:00 Introduction
00:30 Set Interface
04:17 HashSet Class
07:55 Eclipse Demo - Create HashSet & Print
18:40 Eclipse Demo - Set Allows Duplicates! Why?
24:10 Eclipse Demo - Need For equals & hashCode Override
36:43 Eclipse Demo - Remove Item(s) from HashSet
43:12 Eclipse Demo - Check element exists in Hashset
00:00 Introduction
00:30 Set Interface
04:17 HashSet Class
07:55 Eclipse Demo - Create HashSet & Print
18:40 Eclipse Demo - Set Allows Duplicates! Why?
24:10 Eclipse Demo - Need For equals & hashCode Override
36:43 Eclipse Demo - Remove Item(s) from HashSet
43:12 Eclipse Demo - Check element exists in Hashset