← 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?
- A.
a == b - B.
a.getClass() != b.getClass() - C.
a.address != b.address - 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 →