You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
428 B
22 lines
428 B
package pkg;
|
|
|
|
import java.lang.annotation.*;
|
|
import java.util.*;
|
|
|
|
class TypeAnnotations {
|
|
@Target(ElementType.TYPE_USE)
|
|
@interface TA { String value(); }
|
|
|
|
@Target({ElementType.FIELD, ElementType.TYPE_USE})
|
|
@interface MixA { String value(); }
|
|
|
|
private @TA("field type") String f1;
|
|
|
|
private @MixA("field and type") String f2;
|
|
|
|
@TA("return type") int m1() {
|
|
return 42;
|
|
}
|
|
|
|
void m2(@TA("parameter") int i) { }
|
|
} |