Q. What is the output of {1, 2}.add(3)?

A
{1, 2, 3}
B
{1, 2}
C
{3}
D
Error
Solution:

add(3) inserts 3 into the set, resulting in {1, 2, 3}.

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!