Nowy kurs! Każdy programista powinien nauczyć się Generative AI!
Wypróbuj darmową lekcję+ 1
What happens if a set contains duplicate elements
2 odpowiedzi
+ 6
Nothing will happen. It will ignore duplicate elements
set.add(4);
set.add(4);
set.add(5);
set.add(5);
System.out.print(set);
Output: [ 4,5]
0
Thanks a lot!