Which two statements are true concerning constructor injection? (Choose two.)
Which two statements are true concerning constructor injection? (Choose two.)
Constructor injection is preferred over field injection to support unit testing because it makes dependencies explicit and easier to manage. Also, if there is only one constructor, the @Autowired annotation is not required, as the dependency injection framework can automatically use that constructor without additional annotations.
A: @Autowired is not necessary if you have one constructor that instantiates the fields C: Constructor injection is preferred over field injection, as it helps with unit testing. Most IDE's will warn you against field injection anyways.
Contructor injection is preferred because it allows for easier unit testing. If only one constructor is available it will be used to inject dependencies without the need of @Autowired annotation.
As of Spring Framework 4.3, an @Autowired annotation on such a constructor is no longer necessary if the target bean only defines one constructor to begin with. Answer A and C
See other comments why
Field injection is ambiguous and doesn't really tell you which dependencies are mandatory.