If you annotate one of your classes with @Component, which of the following should you do to have Spring automatically detect your class and load it as a bean? (Select one or several answers)

If you annotate one of your classes with @Component, which of the following should you do to have Spring automatically detect your class and load it as a bean? (Select one or several answers)
A . Ensure that you specify a valid bean name in the @Component annotation
B . Ensure that you specify a valid @Scope for the bean
C . Ensure that you have added <context:component scan> in the XML configuration
D . Ensure that <context: annotation-config/> is specified in the XML configuration

Answer: C

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments