+ 1

When do we use Sets or Lists in Java?

sets or Lists java

29th Apr 2017, 11:45 PM
Sammi
Sammi - avatar
1 Answer
+ 4
List can contain duplicate elements and Set can not. Also Set elements cannot be accessed by index. So your choice here depends of your task.
30th Apr 2017, 1:17 AM
Jeth
Jeth - avatar