Код: Выделить всё
@Target(ElementType.TYPE_USE)
@interface Annotation1 { }
@Target(ElementType.METHOD)
@interface Annotation2 { }
public class MyClass {
public @Annotation1 Integer f2(int j, int k) {
return j + k;
}
public @Annotation2 Integer f3(int j, int k) {
return j + k;
}
}
< /code>
Обе аннотации размещаются прямо перед типом возврата (IntegerПодробнее здесь: https://stackoverflow.com/questions/797 ... getelement