Java / Lombok Interview questions
What are the types of Lombok annotations?
Lombok's annotations fall into two broad groups, reflected in their package names.
| Core (lombok.*) | Experimental (lombok.experimental.*) |
| Stable, well-established annotations: @Getter, @Setter, @Data, @Builder, @ToString, @EqualsAndHashCode, and similar. | Newer or more situational features whose API may still change: @Accessors, @FieldDefaults, @Delegate, @UtilityClass, and others. |
| Safe to rely on for long-term stability. | Usable, but expect more possibility of behavior/API changes across Lombok versions. |
import lombok.Getter; // core import lombok.experimental.FieldDefaults; // experimental
The distinction is mainly a signal about stability and maturity rather than a hard functional boundary — experimental annotations work fine in practice, but Lombok's maintainers reserve more freedom to change their behavior across versions than they would for the long-stable core set.
More Related questions...