C
chvid
Why - oh why - does the following code not output the annotation
attached to method test?
import java.lang.reflect.Method;
import java.lang.annotation.Annotation;
@interface AnnTest {
String value();
}
interface Test {
@AnnTest("hello")
void test();
}
public class Main {
public static void main(String args[]) {
for (Method m : Test.class.getMethods()) {
System.out.println("method is "+m.getName());
for (Annotation a : m.getAnnotations())
System.out.println(" annotation is "+a);
}
}
}
-- Christian
Please use the email-address at my homepage:
http://vredungmand.dk
attached to method test?
import java.lang.reflect.Method;
import java.lang.annotation.Annotation;
@interface AnnTest {
String value();
}
interface Test {
@AnnTest("hello")
void test();
}
public class Main {
public static void main(String args[]) {
for (Method m : Test.class.getMethods()) {
System.out.println("method is "+m.getName());
for (Annotation a : m.getAnnotations())
System.out.println(" annotation is "+a);
}
}
}
-- Christian
Please use the email-address at my homepage:
http://vredungmand.dk