Question: In what order do the @PostConstruct annotated method, the init-method parameter method on beans and the afterPropertiesSet() method execute?

  1. 1. afterPropertiesSet() 2. init-method 3. @PostConstruct
  2. 1. @PostConstruct 2. afterPropertiesSet() 3. init-method
  3. 1. init-method 2. afterPropertiesSet() 3. @PostConstruct
  4. You cannot use these methods together-you must choose only one.

Answer: The correct answer of the above question is Option B:1. @PostConstruct 2. afterPropertiesSet() 3. init-method