To resolve ambiguity and specify which bean should be wired when there are multiple beans of the same type, one can use the _____ annotation in Spring

  • @Component
  • @Qualifier
  • @Repository
  • @Service
To resolve ambiguity when there are multiple beans of the same type, the "@Qualifier" annotation in Spring is used. It allows you to specify which bean should be wired by providing the name or ID of the desired bean. The other annotations, such as "@Component," "@Service," and "@Repository," are used for different purposes, like marking classes for component scanning, but they do not resolve bean wiring ambiguity.
Add your answer
Loading...

Leave a comment

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