The @Autowired annotation in Spring can be used to autowire bean on the _____

  • Constructor
  • Field
  • Method
  • Setter
The "@Autowired" annotation in Spring can be used to autowire a bean on a "Field." This means that Spring will automatically inject the required dependency by setting the field directly. "@Autowired" can also be used on constructors, setters, and methods, but in this specific question, the focus is on field injection. Constructor injection, setter injection, and method injection are other ways to achieve dependency injection in Spring.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *