In Spring Boot, which annotation is used to wire beans in the IoC container?

  • @Autowired
  • @Bean
  • @Inject
  • @Resource
In Spring Boot, the @Autowired annotation is commonly used to wire (inject) beans into the IoC (Inversion of Control) container. It allows Spring to automatically identify and inject dependencies into the respective components. While the other annotations (@Inject, @Resource, and @Bean) are related to dependency injection or bean definition, @Autowired is the primary annotation used for this purpose.
Add your answer
Loading...

Leave a comment

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