|
Java example source code file (TargetType17.java)
The TargetType17.java Java example source code/* * @test /nodynamiccopyright/ * @bug 8003280 * @summary Add lambda tests * check that javac recovers succesfully from bad cast conversion to primitive type * @compile/fail/ref=TargetType17.out -XDrawDiagnostics TargetType17.java */ class TargetType17 { interface SAM<X> { boolean m(X x); } byte b = (byte) ()-> true; short s = (short) ()-> 1; int i = (int) ()-> 1; long l = (long) ()-> 1L; float f = (float) ()-> 1.0F; double d = (double) ()-> 1.0; char c = (char) ()-> 'c'; boolean z = (boolean) ()-> true; } Other Java examples (source code examples)Here is a short list of links related to this Java TargetType17.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.