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

Java example source code file (T6885255.java)

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

class, object, t6885255, test

The T6885255.java Java example source code

/**
 * @test /nodynamiccopyright/
 * @bug 6885255
 * @summary -Xlint:rawtypes
 * @compile/ref=T6885255.out -XDrawDiagnostics -Xlint:rawtypes T6885255.java
 */

class T6885255 {

    static class Test<X, Y> {}

    Class<Test> ct; //no warn - outer Class w/ raw param
    Class<Test ctt; //warn - outer Class w/o raw param (2)

    Class<Class cct; //warn - outer Class w/o raw param
    Class<Class> cctt; //warn - outer Class w/o raw param (2)

    Object o1 = (Test)null; //no warn - outer raw and cast
    Object o2 = (Test<Test, Test>)null; //warn - inner raw (2)

    Object o3 = (Class)null; //no warn - outer raw and cast
    Object o4 = (Class<Test>)null; //no warn - outer Class w/ raw param

    Object o5 = (Class<Test)null; //warn - outer Class w/ non raw param (2)
    Object o6 = (Class<Class>)null; //warn - outer Class w/ non raw param (2)

    Object o7 = (Test<Class, Class>)null; //warn - inner raw (2)
    Object o8 = (Test<Class>)null; //warn - inner Class (2)

    boolean b = null instanceof Test; //no warn - raw and instanceof
}

Other Java examples (source code examples)

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

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

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 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.