find Class Annotation - Java java.lang.annotation

Java examples for java.lang.annotation:Class Annotation

Description

find Class Annotation

Demo Code


//package com.java2s;
import java.lang.annotation.Annotation;

public class Main {
    public static void main(String[] argv) throws Exception {
        Class clazz = String.class;
        System.out.println(java.util.Arrays
                .toString(findClassAnnotation(clazz)));
    }// w  w  w  . j a va  2 s. co m

    public static Annotation[] findClassAnnotation(Class<?> clazz) {
        return clazz.getAnnotations();
    }
}

Related Tutorials