S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which annotation is used to prevent a bean from being created automatically?

  • (A) @Bean(false)
  • (B) @DisableAutoCreate
  • (C) @Conditional(false)
  • (D) @ConditionalOnMissingBean
  • Correct Answer - Option(D)
  • Views: 17
  • Filed under category Springboot
  • Hashtags:

Explanation by: Shyam Dubey

@ConditionalOnMissingBean prevents the bean from being created if another bean of the same type is already defined.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.