Here you can find the source of getAnnotation(Object obj, Class> annClass)
public static Annotation getAnnotation(Object obj, Class<?> annClass)
//package com.java2s; import java.lang.annotation.Annotation; public class Main { public static Annotation getAnnotation(Object obj, Class<?> annClass) { return getAnnotation(obj.getClass(), annClass); }/* w ww .j a v a 2 s . c o m*/ @SuppressWarnings({ "rawtypes", "unchecked" }) public static Annotation getAnnotation(Class clazz, Class<?> annClass) { return clazz.getAnnotation(annClass); } }