In Spring, the _____ annotation is used to indicate that a method should be invoked after the bean has been constructed and injected.
- @PostConstruct
- @Autowired
- @BeanPostProcessor
- @Inject
In Spring, the @PostConstruct annotation is used to indicate that a method should be invoked after the bean has been constructed and injected. It is commonly used for initialization tasks that need to be performed after the bean's dependencies have been injected. The other options, such as @Autowired, @BeanPostProcessor, and @Inject, serve different purposes and are not used for the same scenario.
Loading...
Related Quiz
- The error messages of validation constraints in Spring Boot can be externalized using the _____ property in the constraint annotation.
- The _____ annotation in JUnit is used to indicate that a method should be executed after all tests in the current test class have been run.
- In Spring Boot, _____ and _____ are popular tools for managing database migrations.
- In a Spring Boot application, how would you secure microservices using OAuth2 and JWT?
- In Spring Framework, what is the difference between @Autowired and @Inject annotations?