← Quiz: SOLID Principles: all 10 questions
Quiz: SOLID Principles · Question 10 of 10
A basic printer class is forced to implement scan() and fax() with errors. What is the fix?
A basic printer class is forced to implement scan() and fax() with errors. What is the fix?
- A.Split the big interface into Printer, Scanner and Fax interfaces
- B.Make all three methods static
- C.Merge everything into one class
- D.Remove the printer class
Answer & explanation
Correct answer: Split the big interface into Printer, Scanner and Fax interfaces
Interface Segregation: clients should not depend on methods they do not use.
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 →