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

Java example source code file (T6241723.java)

This example Java source code file (T6241723.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

a21, deprecated, t6241723, z21

The T6241723.java Java example source code

/*
 * @test  /nodynamiccopyright/
 * @bug 6241723
 * @summary compiler can miss some references to at-Deprecated classes
 * @compile/fail/ref=T6241723.out -XDrawDiagnostics -Xlint:deprecation -Werror T6241723.java
 */

@Deprecated class A1
{
}

class A2
{
    @Deprecated
        static class A21 { }
}


public class T6241723 {
    // references to earlier classes
    A1 a1;      // warning
    A2 a2;      // OK
    A2.A21 a21; // warning

    // forward references to classes not yet seen
    Z1 z1;      // warning
    Z2 z2;      // OK
    Z2.Z21 z21; // warning
}



@Deprecated class Z1
{
}

class Z2
{
    @Deprecated
        static class Z21 { }
}

Other Java examples (source code examples)

Here is a short list of links related to this Java T6241723.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.