Practice API annotation vocabulary: @deprecated, @throws, @since, @version, @see, and OpenAPI annotations like @ApiOperation and @Schema.
0 / 5 completed
1 / 5
A Java method is annotated with `@Deprecated`. What does this annotation signal to other developers?
@Deprecated marks an API element as outdated. IDEs show a strikethrough and generate warnings when it's used. The convention is to also add a Javadoc comment explaining the replacement. Using deprecated APIs means your code will eventually break.
2 / 5
A method's Javadoc includes `@throws IllegalArgumentException if the input is null`. What does this tag communicate?
The @throws tag (or @exception) documents the exceptions a method can throw and the conditions that trigger them. This is critical API contract information — callers must decide whether to catch the exception, validate input first, or let it propagate.
3 / 5
An API method has `@since 2.3.0` in its documentation. What does this tell you?
@since documents which version of the API first introduced a method or class. This helps developers determine whether their target platform/library version includes the feature, and it documents the API's evolution history.
4 / 5
A Spring Boot controller method uses `@ApiOperation(value = 'Get user by ID', notes = 'Returns a single user object')`. What framework does this annotation come from?
@ApiOperation is a Springfox/Swagger annotation (or its Springdoc equivalent @Operation) that enriches the generated OpenAPI documentation. The `value` provides a short summary and `notes` adds a longer description visible in the Swagger UI.
5 / 5
An OpenAPI schema class has `@Schema(description = 'User email address', example = 'user@example.com', required = true)`. What is the primary benefit of the `example` field?
The `example` field in @Schema populates the generated API documentation with a concrete sample value. This makes the documentation more useful — developers can see a realistic value rather than just a type description, and it appears in 'Try it out' requests in Swagger UI.