Files
2022-10-06 15:55:11 +00:00

14 lines
289 B
Java

// "Make 'x' effectively final by moving initializer to the 'if' statement" "true-preview"
class X {
void test(boolean a) {
int x;
if (a) {
x = 1;
}
else {
x = 0;
System.out.println("hello");
}
Runnable r = () -> System.out.println(x);
}
}