Java Initialize Variable Extension
2 answers
It will behave as expected. If you try to use a field before defining it, the compiler throws an error:
public class Foo {
int a = b++; //compiler error here
int b = 0;
}
This is documented in JLS 8.3
In your case, the output of the variables, if not changed, would be:
a = 3
b = 0
c = 1
d = 2
+4
source to share