Is it possible to put annotations on return Type

Viewed 9581

I came across this code

@Override
public @NotNull Class<?> getProviderClass() {
    return this.getClass();
}

and I am wondering if it is the same as the code below:

@Override
@NotNull
public Class<?> getProviderClass() {
    return this.getClass();
}

Note: that the @NotNull annotation is in different positions relative to the accessModifier

Is the annotation on the return type in this case or on the method?

2 Answers
Related