Kizspy | Question: 42
(Choose 1 answer)
FLEVER LOW LOM
Can we add a duplicated element into a Set in Java?
A. No, if we add a duplicated element into a Set, the Set will keep the old element and remove the new one.
B. No, the procedure will raise an exception
C. Yes, we can add a duplicated element into a Set and the Set will keep the new element and remove the old
one
D. Yes, we can add a duplicated element into a Set and the Set will maintain 2 elements including the old
element and the duplicated one