Originally posted by Joanne Neal:
I think you are confusing copy and clone. A Collection object just contains references to each of the objects. If you copy the contents of one Collection to another, the second Collection also just contains references. No new objects are created.
If someone asks you that in an interview,
you should ask for clarification - because the words and their definitions are very similar. Any object in
java simply contains references, Object is a reference type.
You can be picky about the verbage for the sake of being picky and tedious, or you can try to answer his question. I'm not sure I could work for a company if the best interview question they could think of is how to copy a collection - just copy references?
Quality post Joanne