Chapter 10: Problem 2
HashSet set1 = new HashSet(); set1.add (1) ; set1.add (2) ; set1. add (1) ; Hashset \(\operatorname{set} 2=\) new HashSet ()\(;\) \(\operatorname{set} 2 \cdot \operatorname{add}(4) ;\) set \(2 \cdot \operatorname{add}(3) ;\) set1.addAll \((\operatorname{set} 2) ;\) tem.out.println(set1): a. \([1,2,3,4]\) b. \([1,2,1,4,3]\) c. \([1,2,4,3]\) d. \([2,1,4,3]\)
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.