@Component marks a class for Spring to detect and register as a bean: an object managed in the Spring context. It is a stereotype annotation that reduces the code needed to add application classes to the context. section 2.2 section 2.5
Marking a class is only half the setup. In the configuration shown here, @ComponentScan tells Spring which packages to search. When the context is created, Spring finds the marked classes, creates their instances, and adds them as beans. section 2.2
Register a Parrot bean
Mark the class with `@Component`, then configure scanning with `@Configuration` and `@ComponentScan(basePackages = "com.example.beans")`. If Parrot is in that package, an `AnnotationConfigApplicationContext` using the configuration can retrieve it with `context.getBean(Parrot.class)`. No @Bean method is needed for Parrot. section 2.2
Figure 2.6 When using stereotype annotations, consider two steps. First, use the stereotype annotation (@Component) to annotate the class for which you want Spring to add a bean to its context. Second, use the @ComponentScan annotation to tell Spring where to look for classes annotated with stereotype annotations.

The diagram pairs the class annotation with the package-scanning configuration. section 2.2
Use @Component on concrete classes Spring should instantiate, not on interfaces or abstract classes. Add an object to the context when it needs Spring to manage it; managing objects without a benefit adds complexity. Components can implement interfaces, allowing other beans to depend on those interfaces. section 4.2.1
For application classes you can change, @Component is a concise alternative to a @Bean method. Use @Bean when you need direct control over creation, multiple instances of the same type, or a bean whose class you cannot annotate, such as a third-party class. Both approaches can be used together. section 2.2 section 2.5
Wire components together
A Person and a Parrot can both be components. An @Autowired Parrot field tells Spring to inject the Parrot bean into Person. Field injection is straightforward for examples and tests, but is avoided in production code because of maintainability and testability concerns. section 3.2.1
