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

Quiz: SOLID Principles · Question 2 of 10

What does "open for extension, closed for modification" mean?

What does "open for extension, closed for modification" mean?

  1. A.Code should never be changed after release
  2. B.Every class must be public
  3. C.New behaviour is added by writing new code, without editing code that already works
  4. D.Classes should be open source
Answer & explanation

Correct answer: New behaviour is added by writing new code, without editing code that already works

For example, a new discount type is a new class; the billing function stays as it is.

Can you get the rest right without peeking?

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

Start the quiz →