Bean lifecycle — the complete sequence of events from bean creation to destruction in the Spring IoC container.
Phases:
1@Component2public class MyBean implements InitializingBean, DisposableBean {3 @PostConstruct4 public void init() {5 System.out.println("Bean initialized");6 }7 @Override8 public void afterPropertiesSet() {9 System.out.println("Properties set");10 }11 @PreDestroy12 public void cleanup() {13 System.out.println("Bean destroyed");14 }15}
Scope impact: Singleton beans live for app lifetime; prototype beans are not managed after creation.