🎙 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 6 of 10

According to Dependency Inversion, what should a high-level FeeReminder class depend on?

According to Dependency Inversion, what should a high-level FeeReminder class depend on?

  1. A.Directly on EmailSender
  2. B.An abstraction such as MessageSender
  3. C.The database driver
  4. D.Nothing — it should create everything itself
Answer & explanation

Correct answer: An abstraction such as MessageSender

Both the business rule and the email code depend on the abstraction, so senders can be swapped.

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 →