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 marks callback methods that must return void. These methods are invoked by the container before a stateful session bean is passivated (serialized to secondary storage), and they follow the EJB lifecycle callback convention of having no return value.