|
Java example source code file (TypeOnAnonClass.java)
The TypeOnAnonClass.java Java example source code/* * @test /nodynamiccopyright/ * @bug 8023682 * @summary Cannot annotate an anonymous class with a target type of TYPE * @compile/fail/ref=TypeOnAnonClass.out -XDrawDiagnostics TypeOnAnonClass.java */ import java.lang.annotation.*; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) @interface X {} interface Foo {} class TypeOnAnonClass { void m() { new @X Foo() {}; } } Other Java examples (source code examples)Here is a short list of links related to this Java TypeOnAnonClass.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
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.