Multiple choice java

How are life cycle methods called?

  1. By thin clients.

  2. By calls to the database.

  3. By the J2EE server.

  4. By the bean's container.

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

Lifecycle methods (like @PostConstruct or ejbCreate) are managed and invoked by the EJB container (or the J2EE server environment) as it manages the bean's existence. Clients and databases do not trigger these internal transitions directly; the container ensures the bean is ready before client use.