🎙 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

Adding a new payment type by writing a new class, without editing existing code, follows:

Adding a new payment type by writing a new class, without editing existing code, follows:

  1. A.Single Responsibility
  2. B.Open/Closed
  3. C.Interface Segregation
  4. D.Liskov Substitution
Answer & explanation

Correct answer: Open/Closed

Open for extension (new class), closed for modification (no edits).

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 →