mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 15:53:37 +00:00
16 lines
416 B
Java
16 lines
416 B
Java
import java.lang.annotation.Retention;
|
|
import java.lang.annotation.RetentionPolicy;
|
|
|
|
public class JavaClass {
|
|
|
|
@Retention(RetentionPolicy.RUNTIME)
|
|
@interface Foo {
|
|
int value();
|
|
}
|
|
|
|
@Foo(KotlinClass.FOO_INT)
|
|
public String test() throws NoSuchMethodException {
|
|
return KotlinClass.FOO_STRING +
|
|
JavaClass.class.getMethod("test").getAnnotation(Foo.class).value();
|
|
}
|
|
} |