Which annotation in Spring is used to automate the wiring of bean dependencies?
- @Autowired
- @Bean
- @Configuration
- @Inject
In Spring, the @Autowired annotation is used to automate the wiring of bean dependencies. When applied to fields, constructors, or methods, it allows Spring to automatically inject the appropriate beans or dependencies, making the code more readable and reducing the need for manual wiring.
Loading...
Related Quiz
- The _____ file is crucial for defining custom Auto Configuration classes in Spring Boot.
- In which scenario would you use the @ConditionalOnProperty annotation in Auto Configuration?
- To externalize configuration properties in Spring Boot, the _____ annotation can be used on a configuration properties class.
- What is the significance of the @Valid annotation in a method signature within a Controller?
- In Spring Cloud, the _____ is used for defining service instance metadata and implementing custom service instance selection policies.