VMware vRealize Automation 8.x (2022) — Question 7

If a class is annotated with @Component, what should be done to have Spring automatically detect the annotated class and load it as a bean? (Choose the best answer.)

Answer options

Correct answer: B

Explanation

The correct answer is B because the @ComponentScan annotation is necessary for Spring to scan and register beans annotated with @Component. The other options, while related to bean configuration, do not directly affect the detection of the component by Spring.