The @Service annotation in Spring Boot is a specialization of the _____ annotation.
- @Autowired
- @Component
- @Controller
- @Repository
The @Service annotation in Spring Boot is a specialization of the @Component annotation. Both @Service and @Component are used for component scanning, allowing Spring to identify and manage the annotated class as a Spring bean. While @Controller and @Autowired are important in Spring applications, they serve different purposes and are not specializations of @Service.
Loading...
Related Quiz
- You need to inject a collection of beans in a certain order in your Spring Boot application. How would you ensure the correct order of beans in the injected collection?
- What is the significance of the spring-boot-starter-parent in a Spring Boot project's POM file?
- In Spring Boot, the _____ annotation is used to specify that a class is a candidate for component scanning.
- If you need to extend the functionality of method security expressions in a Spring application to support custom permissions, how would you go about integrating a custom permission evaluator?
- What is the main responsibility of an OAuth2 Authorization Server in a Spring Boot application?