Computer scienceProgramming languagesJavaCode organizationObject-oriented programmingOther conceptsAnnotations

Detecting annotations

Printing out annotations

Report a typo

You need to implement a method that prints out all annotations of the given class. The output shouldn't contain names of any packages or parentheses.

Annotation1
Annotation2
Annotation3
...

Don't forget to eliminate the @ from the annotation name.

Sample Input 1:

No input

Sample Output 1:

Deprecated
JavaBean
Write a program in Java 17
class AnnotationUtils {

public static void printClassAnnotations(Class classObject) {
// write your code here
}
}
___

Create a free account to access the full topic