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

Quiz: Copy Constructor and Deep Copy · Question 6 of 10

What does the rule of three say?

What does the rule of three say?

  1. A.A class should have at most three constructors
  2. B.If you need a custom destructor, copy constructor or copy assignment, you probably need all three
  3. C.Every class needs three member variables
  4. D.Use three levels of inheritance at most
Answer & explanation

Correct answer: If you need a custom destructor, copy constructor or copy assignment, you probably need all three

They all exist because the class manages a resource by hand.

Can you get the rest right without peeking?

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

Start the quiz →