|
Java example source code file (MethodReference38.java)
The MethodReference38.java Java example source code
/*
* @test /nodynamiccopyright/
* @bug 8003280
* @summary Add lambda tests
* The qualifier type of a constructor reference must be a concrete class
* @compile/fail/ref=MethodReference38.out -XDrawDiagnostics MethodReference38.java
*/
class MethodReference38 {
interface SAM<R> {
R invoke();
}
@interface A { }
interface I { }
static abstract class AC { }
enum E { }
void test() {
SAM s1 = A::new;
SAM s2 = I::new;
SAM s3 = AC::new;
SAM s4 = E::new;
}
}
Other Java examples (source code examples)Here is a short list of links related to this Java MethodReference38.java source code file: |
| ... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
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.