Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumJavaannotations and retentionSingle-choice MCQ

Given the meta-annotation setup below, what happens at runtime?

import java.lang.annotation.*; @Retention(RetentionPolicy.CLASS) @interface Audited {} @Audited class Service {} public class Main { public static void main(String[] args) { boolean present = Service.class.isAnnotationPresent(Audited.class); System.out.println(present); } }