1.

When the container calls setter methods after invoking a constructor with no arguments it is known as ________________(a) Constructor-based dependency injection(b) Setter-based dependency injection(c) Setter-Seller dependency injection(d) No-Constructor dependency injectionI have been asked this question in an interview for internship.My question comes from The Controller Component topic in division Mastering JUnit of JUnit

Answer»

Right choice is (b) SETTER-based dependency injection

The explanation is: Setter-based DI is accomplished by the CONTAINER calling setter methods on your beans after INVOKING a no-argument constructor or no-argument static factory METHOD.



Discussion

No Comment Found

Related InterviewSolutions