🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: References and Copying: all 10 questions

Quiz: References and Copying · Question 10 of 10

Which statement about a shallow copy of a list is true?

Which statement about a shallow copy of a list is true?

  1. A.It copies the inner objects but not the outer list
  2. B.It creates a new outer list whose items are the same objects as before
  3. C.It is exactly the same as writing b = a
  4. D.It only works for lists of numbers
Answer & explanation

Correct answer: It creates a new outer list whose items are the same objects as before

A shallow copy is a new container holding the same item references.

Can you get the rest right without peeking?

Take the timed Quiz: References and Copying quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →