What I see: missing semicolon at line 8.
@rafaelcodes.bsky.social at #JavaZone.
What I see: missing semicolon at line 8.
@rafaelcodes.bsky.social at #JavaZone.
metr.org/blog/2025-07...
metr.org/blog/2025-07...
void main() {
class C {
static void run() {
System.out.println("From class");
}
}
Runnable C = () -> System.out.println("From var");
Runnable r = C::run;
r.run();
}
IDE resolves C properly to a variable.
void main() {
class C {
static void run() {
System.out.println("From class");
}
}
Runnable C = () -> System.out.println("From var");
Runnable r = C::run;
r.run();
}
IDE resolves C properly to a variable.
void main() {
O<O<O>> O = O<O>::<O>O;
}
interface O<T> {
void use(O c);
default <C> void O() {
}
}
void main() {
O<O<O>> O = O<O>::<O>O;
}
interface O<T> {
void use(O c);
default <C> void O() {
}
}
A: Outer.Inner.foo
B: Outer2.foo
C: Compilation error
D: Runtime exception
(No idea if it's possible to post a poll here)
A: Outer.Inner.foo
B: Outer2.foo
C: Compilation error
D: Runtime exception
(No idea if it's possible to post a poll here)