September 2019
Intermediate to advanced
816 pages
18h 47m
English
Trying to fetch by type a single annotation declared directly on a certain artifact can be done as shown in the following example:
Class<Melon> clazz = Melon.class;Method methodEat = clazz.getDeclaredMethod("eat");Ripe methodRipeAnnotation = methodEat.getDeclaredAnnotation(Ripe.class);