# 2V0-7222 — Question 602

**Type:** multiple_choice
**Topics:** topic_1

## Question

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.)

## Correct Answer

_See scenario._

## Explanation

Selected Answer: B
To autodetect these classes and register the corresponding beans, you need to add @ComponentScan to your @Configuration class
https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#spring-core

**Reference:** examtopics_top_comment

---
Source: https://hiexam.net/q/vmware/2V0-7222/602  
Practice (tracked): https://hiexam.net/study/2V0-7222/practice