Skip to content
Sharp

Java Annotations · interview question

How does Lombok help reduce boilerplate code in Java?

Multiple choiceMediumchapter-16-curatedpremiumjava-annotationsannotation-processors
Choose one answer
Answer and explanation

Correct answer

D. By generating code at compile-time based on annotations.

Why

Lombok uses compile-time annotation processing to generate boilerplate code such as getters, setters, and constructors, which reduces the amount of code developers need to write by hand.

Test yourself on Java Annotations

A free test with instant, explained results. No account needed.

Start free test
All Java Annotations questions →