Which annotation in Spring Boot is used to indicate that a class should be considered as a candidate for creating beans?

  • @BeanCandidate
  • @BeanCandidateClass
  • @BeanScan
  • @ComponentScan
In Spring Boot, the @ComponentScan annotation is used to indicate that a class should be considered as a candidate for creating beans. It allows Spring to scan packages and identify classes annotated with @Component, @Service, and other stereotype annotations, making them eligible for bean creation and dependency injection. It's a crucial part of Spring Boot's auto-configuration.
Add your answer
Loading...

Leave a comment

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