← 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?
- A.It is a technique for achieving Dependency Inversion, by passing dependencies in from outside
- B.It is another name for inheritance
- C.It means a class creates all its dependencies itself
- 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 →