Skip to content
Sharp

Spring Core · interview question

Why might you choose to use a @Configuration class in a Spring Boot application?

Multiple choiceMediumchapter-9-curatedpremiumspring-corecontrollers-services-repositories
Choose one answer
Answer and explanation

Correct answer

B. To define beans using @Bean methods.

Why

@Configuration classes are used to define beans using @Bean methods. This allows for complex bean definitions and configurations that cannot be easily achieved with annotations alone.

Test yourself on Spring Core

A free test with instant, explained results. No account needed.

Start free test
All Spring Core questions →