@PostConstruct marks a method for Spring to call after a bean’s constructor finishes. Use it to set initial state when Spring creates a component. section 2.2
@Component
public class Parrot {
private String name;
@PostConstruct
public void init() {
this.name = "Kiki";
}
// Omitted code
}The Parrot component’s init method sets its name to “Kiki”; Spring invokes the annotated method after construction. section 2.2
The annotation comes from Jakarta EE; a Maven application needs the jakarta.annotation-api dependency to use it. section 2.2

