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.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *