In the previous section, we learned about the @Autowired annotation that handles only wiring. You still have to define the beans themselves so the container is aware of them and can inject them for you. Spring Framework provides us with some special annotations. These annotations are used to create Spring beans automatically in the application context. So, there is no need to configure the bean explicitly either using XML-based or Java-based configuration.
The following are the stereotype annotations in Spring:
Let's look at the following CustomerService implementation class. Its implementation is annotated with @Component. Please refer to the ...