alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Java example source code file (AnnotationTypeElementModifiers.java)

This example Java source code file (AnnotationTypeElementModifiers.java) is included in the alvinalexander.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Learn more about this Java project at its project page.

Java - Java tags/keywords

annotationtypeelementmodifiers

The AnnotationTypeElementModifiers.java Java example source code

/*
 * @test /nodynamiccopyright/
 * @bug 8028428
 * @summary Test that only 'public' and 'abstract' elements compile
 * @compile/fail/ref=AnnotationTypeElementModifiers.out -XDrawDiagnostics AnnotationTypeElementModifiers.java
 */

public @interface AnnotationTypeElementModifiers {
    // First 4 should work
    public int A();
    public int AA() default  1;

    abstract int B();
    abstract int BB() default  1;

    // These shouldn't work
    private int C();
    private int CC() default  1;

    protected int D();
    protected int DD() default  1;

    static int E();
    static int EE() default  1;

    final int F();
    final int FF() default  1;

    synchronized int H();
    synchronized int HH() default  1;

    volatile int I();
    volatile int II() default  1;

    transient int J();
    transient int JJ() default  1;

    native int K();
    native int KK() default  1;

    strictfp float L();
    strictfp float LL() default  0.1f;

    default int M();
    default int MM() default  1;
}

Other Java examples (source code examples)

Here is a short list of links related to this Java AnnotationTypeElementModifiers.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.