2V0-72.22PSE · Question #92
Which two annotations are meta-annotations on the @SpringBootApplication composed annotation? (Choose two.)
The correct answer is A. @Configuration B. @ComponentScan. @SpringBootApplication is a composed annotation that bundles several meta-annotations, and @Configuration (A) and @ComponentScan (B) are two of them - @ComponentScan is applied directly on @SpringBootApplication to enable component discovery, while @Configuration is pulled in…
Question
Which two annotations are meta-annotations on the @SpringBootApplication composed annotation? (Choose two.)
Options
- A@Configuration
- B@ComponentScan
- C@SpringBootConfiguration
- D@SpringApplication
- E@AutoConfiguration
How the community answered
(22 responses)- A91% (20)
- C5% (1)
- D5% (1)
Explanation
@SpringBootApplication is a composed annotation that bundles several meta-annotations, and @Configuration (A) and @ComponentScan (B) are two of them - @ComponentScan is applied directly on @SpringBootApplication to enable component discovery, while @Configuration is pulled in via @SpringBootConfiguration (which itself carries @Configuration), marking the class as a bean definition source. The distractors are wrong for distinct reasons: @SpringBootConfiguration (C) is actually a wrapper around @Configuration rather than one of the two target annotations the question seeks; @SpringApplication (D) is not an annotation at all - it's the class you call in main(); and @AutoConfiguration (E) is used to mark third-party auto-configuration classes, not part of @SpringBootApplication itself. Note that @EnableAutoConfiguration is the third key meta-annotation on @SpringBootApplication but is not listed as a choice here.
Memory tip: Think of @SpringBootApplication as "Configure + Scan + Enable" - Configuration, Scan (ComponentScan), and EnableAutoConfiguration. If you see @SpringBootConfiguration on an exam, remember it's just @Configuration wearing a Spring Boot hat.
Topics
Community Discussion
No community discussion yet for this question.