ExamGecko
Question list
Search
Search

Question 1 - 2V0-72.22 discussion

Report
Export

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

A.
Ensure a valid bean name in the @Component annotation is specified.
Answers
A.
Ensure a valid bean name in the @Component annotation is specified.
B.
Ensure a valid @ComponentScan annotation in the Java configuration is specified.
Answers
B.
Ensure a valid @ComponentScan annotation in the Java configuration is specified.
C.
Ensure a valid @Scope for the class is specified.
Answers
C.
Ensure a valid @Scope for the class is specified.
D.
Ensure a valid @Bean for the class is specified.
Answers
D.
Ensure a valid @Bean for the class is specified.
Suggested answer: A

Explanation:

Reference: https://www.baeldung.com/spring-component-annotation

asked 16/09/2024
Arash Rind
42 questions
NextNext
User
Your answer:
0 comments
Sorted by

Leave a comment first