mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-26 12:20:55 +07:00
14 lines
289 B
Java
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);
|
|
}
|
|
} |