What should be the return type of the method using @PrePassivate?
-
Object
-
void
-
String
-
Boolean
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.