Spring Boot - Spring AnnotationsWhich annotation enables automatic scanning of components in Spring Boot?A@ComponentScanB@EnableAutoConfigurationC@SpringBootApplicationD@BeanCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand component scanning@ComponentScan tells Spring where to look for components.Step 2: Relation to @SpringBootApplication@SpringBootApplication includes @ComponentScan, but @ComponentScan is the specific annotation for scanning.Final Answer:@ComponentScan -> Option AQuick Check:@ComponentScan triggers component scanning [OK]Quick Trick: @ComponentScan triggers scanning [OK]Common Mistakes:Confusing @EnableAutoConfiguration with scanningAssuming @Bean triggers scanningThinking @SpringBootApplication alone is scanning
Master "Spring Annotations" in Spring Boot9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallPerf
More Spring Boot Quizzes Application Configuration - @ConfigurationProperties for type-safe config - Quiz 5medium Application Configuration - Profile-based configuration - Quiz 15hard Exception Handling - Validation error responses - Quiz 1easy Logging - Log formatting configuration - Quiz 6medium REST Controllers - @PutMapping and @DeleteMapping - Quiz 12easy Request and Response Handling - Handling path variables and query params together - Quiz 9hard Spring Annotations - @Profile for environment-specific beans - Quiz 7medium Spring Annotations - @PostConstruct and @PreDestroy - Quiz 12easy Spring Boot Fundamentals - POM.xml and dependencies - Quiz 11easy Spring Boot Fundamentals - Embedded server concept - Quiz 13medium