S

Shyam Dubey • 3.70K Points
Extraordinary

Q. Which annotation helps create a singleton bean in Spring Boot?

  • (A) @Singleton
  • (B) @Scope("singleton")
  • (C) @SingleBean
  • (D) @SingleInstance
  • Correct Answer - Option(B)
  • Views: 7
  • Filed under category Springboot
  • Hashtags:

Explanation by: Shyam Dubey
@Scope("singleton") defines that the bean will be a singleton, which is also the default scope in Spring.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.