← 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?
- A.Code should never be changed after release
- B.Every class must be public
- C.New behaviour is added by writing new code, without editing code that already works
- 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 →