Multiple choice technology architecture

What should be the return type of the method using @PrePassivate?

  1. Object

  2. void

  3. String

  4. Boolean

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The @PrePassivate annotation in EJB indicates a callback method that is invoked before a stateful session bean is passivated (temporarily serialized to secondary storage). Like other lifecycle callback methods such as @PostConstruct and @PreDestroy, it must return void and throw no checked exceptions.