import java.lang.annotation.*;

@Retention(RetentionPolicy.RUNTIME)
@interface TersimpanRuntime {}

@interface TanpaRetention {} // tanpa @Retention: kebijakan bawaan CLASS

@TersimpanRuntime
@TanpaRetention
class Pengaturan {}

public class KontrasRetensi {
    public static void main(String[] args) {
        System.out.println("TersimpanRuntime terbaca? "
                + (Pengaturan.class.getAnnotation(TersimpanRuntime.class) != null));
        System.out.println("TanpaRetention terbaca?  "
                + (Pengaturan.class.getAnnotation(TanpaRetention.class) != null));

        Retention r = Override.class.getAnnotation(Retention.class);
        Retention d = Deprecated.class.getAnnotation(Retention.class);
        System.out.println("Retention @Override   : " + r.value());
        System.out.println("Retention @Deprecated : " + d.value());
    }
}
