import java.lang.annotation.*; import java.lang.reflect.*; public class InnerAnnotations { public static void main(String... args){ } public static int seven(){return 7; } public static final int eight = 8; } @Foo("hmm") class A { protected @interface Foo{ String value(); } protected interface Bar{ void pip(); } @Foo("hans") void pip(){System.out.println("A::pip");} } @Foo((InnerAnnotations.eight > 5 ?"lars":"per")) class B extends A implements A.Bar{ @Foo("ben") public void pip() {System.out.println("B::pip");} } @A.Foo("lars") class X { @A.Foo("ben") public void pip() {System.out.println("X::pip");} }