1.

What is the default clone of HashSet?(a) Deep clone(b) Shallow clone(c) Plain clone(d) Hollow cloneI have been asked this question in an international level competition.The question is from Data Structures-Set topic in division java.util – The Collections Framework of Java

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