I am in the beginning of study of Spring framework and I read this in Spring official docs.
“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. However, if several constructors are available, at least one must be annotated to teach the container which one to use.”
I wander what happen under the hood in Spring framework to make @Autowired annotation unnecessary if it has just one constructor and why? Also why that not happen in case of multiple constructor?
Sara Alaa Ragab is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.