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.
Loading...
Related Quiz
- The _____ annotation in Spring Boot is used to test only the web layer by disabling full auto-configuration and applying only relevant web configurations.
- In Spring Boot, how can you implement a cache-aside caching strategy effectively?
- In Spring Security, what is the significance of configuring a global method security, and how does it differ from standard method security configurations?
- To handle an exception thrown by a specific method in a controller, the _____ annotation is used on a method within that controller.
- In Spring Boot, to map HTTP GET requests to a specific handler method, the _____ annotation is used.