In Spring, explain the significance of init-method and destroy-method attributes on a bean?
Answered
In Spring, explain the significance of init-method and destroy-method attributes on a bean?
Best answer
The init-method and destroy-method can be used to provide custom code that will be invoked by the Spring container. The init-method is invoked immediately after the bean is initialized and the destroy-method is invoked before the bean is removed from the container.