S

Shyam Dubey • 3.70K Points
Extraordinary

Q. How do you define a primary bean when multiple beans of the same type exist?

  • (A) Using @Main
  • (B) Using @Primary
  • (C) Using @Priority
  • (D) Using @Qualifier
  • Correct Answer - Option(B)
  • Views: 11
  • Filed under category Springboot
  • Hashtags:

Explanation by: Shyam Dubey
@Primary is used to give a bean preference when multiple candidates are found.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.