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

Quiz: Shallow and Deep Copy · Question 10 of 10

Student b = a.clone(); (a correct shallow clone). Which of these is true?

Student b = a.clone(); (a correct shallow clone). Which of these is true?

  1. A.a == b
  2. B.a.getClass() != b.getClass()
  3. C.a.address != b.address
  4. D.a.address == b.address
Answer & explanation

Correct answer: a.address == b.address

The Student objects differ, but the shallow copy shares the same Address reference.

Can you get the rest right without peeking?

Take the timed Quiz: Shallow and Deep Copy quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →