Skip to content
Sharp

Spring Core · interview question

Which annotation is used to apply validation constraints to a Java Bean?

Multiple choiceEasychapter-9-curatedpremiumspring-corepersistence-and-validation
Choose one answer
Answer and explanation

Correct answer

C. @Valid

Why

The @Valid annotation is used to indicate that a bean should be validated against its constraints, typically in conjunction with other annotations like @NotNull or @Size.

Test yourself on Spring Core

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

Start free test
All Spring Core questions →