Broadcom-VMware
2V0-72.22 · Question #88
Which is the correct approach to register for a bean destruction callback?
The correct answer is B. Annotate the callback method with @PreDestroy. See the full explanation below for the reasoning.
Question
Which is the correct approach to register for a bean destruction callback?
Options
- AAnnotate the callback method with @PostDestroy.
- BAnnotate the callback method with @PreDestroy.
- CAdd the @Lazy annotation to the bean configuration.
- DConfigure the bean instance to use prototype scope.
How the community answered
(27 responses)- A4% (1)
- B81% (22)
- C4% (1)
- D11% (3)
Community Discussion
No community discussion yet for this question.