1.

What is the default clone of HashSet?(a) Deep clone(b) Shallow clone(c) Plain clone(d) Hollow clone

Answer» The correct option is (b) Shallow clone

Explanation: Default clone() method uses shallow copy. The internal elements are not cloned. A shallow copy only copies the reference object.


Discussion

No Comment Found

Related InterviewSolutions