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

Quiz: SOLID in Java · Question 9 of 10

Which statement about Dependency Injection is correct?

Which statement about Dependency Injection is correct?

  1. A.It is a technique for achieving Dependency Inversion, by passing dependencies in from outside
  2. B.It is another name for inheritance
  3. C.It means a class creates all its dependencies itself
  4. D.It only works with the Spring framework
Answer & explanation

Correct answer: It is a technique for achieving Dependency Inversion, by passing dependencies in from outside

You can inject by hand through constructors, as in this lesson; Spring just automates it.

Can you get the rest right without peeking?

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

Start the quiz →