🎙 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 3 of 10

What does super.clone() do inside a class that implements Cloneable?

What does super.clone() do inside a class that implements Cloneable?

  1. A.Calls the class's constructor again
  2. B.Creates a deep copy of every field
  3. C.Returns the same object
  4. D.Creates a new object and copies each field value as it is
Answer & explanation

Correct answer: Creates a new object and copies each field value as it is

Object.clone() makes a field-by-field (shallow) copy without running a constructor.

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 →