In Spring Boot, the _____ annotation is used to specify that a class is a candidate for component scanning.
- @ComponentScan
- @Configuration
- @Component
- @Autowired
In Spring Boot, the @Component annotation is used to specify that a class is a candidate for component scanning. This annotation marks a Java class as a bean so that the Spring container can recognize it and manage it. The other options, such as @ComponentScan, @Configuration, and @Autowired, have different purposes within the Spring framework.
Loading...
Related Quiz
- integrate a custom authentication provider in Spring Security for implementing a custom authentication mechanism?
- How can you enable transaction management in a Spring Boot application?
- You are tasked with implementing API Gateway in a Spring Cloud microservices environment. What considerations and configurations would you take into account to ensure proper routing, filtering, and security?
- For unit testing repositories in Spring Boot, the _____ annotation is used to disable full auto-configuration and instead apply only configuration relevant to JPA tests.
- How can you configure property sources in a specific order in Spring Boot for resolving properties?