LearnFrenzy
Sign in Take a free test

Object Class and Wrapper Classes · Object and Wrapper Classes MCQ · Question 7

What a shallow copy shares Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 7 Back to Exercise

After a shallow clone of an object with a List field, what is true?

  • A The list is copied
  • B Both objects refer to the same list Correct
  • C The list is null in the clone
  • D The list becomes immutable
Correct Answer: Option B

Only references are copied; copy the list yourself for a deep copy.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links