/* This prints "@a() @b() @c()".  I.e., they are all annotations of the class,
 * not one another.  See also AnnotationsCannotNest.java.
 */

import java.lang.annotation.Annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

@Retention(RetentionPolicy.RUNTIME) @interface a { }
@Retention(RetentionPolicy.RUNTIME) @interface b { }
@Retention(RetentionPolicy.RUNTIME) @interface c { }

@a @b @c class AnnotationsAreFlat {
	static public void main(String[] args) throws Exception {
		Class me = Class.forName("AnnotationsAreFlat");
		Annotation[] annotations = me.getDeclaredAnnotations();
		for (Annotation a : annotations) {
			System.out.println(a.toString());
		}
	}
}

