1.

Constructor-based DI is preferred for ___________(a) Optional dependencies(b) Mandatory dependencies(c) All dependencies(d) No dependencyThe question was asked by my college professor while I was bunking the class.My question is from The Controller Component topic in chapter Mastering JUnit of JUnit

Answer»

The correct CHOICE is (B) Mandatory dependencies

The explanation is: Since there has to be at LEAST one ARGUMENT, Constructor-based DI is preferred for Mandatory dependencies.



Discussion

No Comment Found

Related InterviewSolutions