-
Bug
-
Resolution: Fixed
-
P3
-
1.0, 1.1.3
-
1.2beta
-
x86, sparc
-
solaris_2.4, windows_nt
-
Not verified
The following program yields "5, 6".
class Lang {
int i = m();
int j = 0;
Lang() {
System.out.println(i + ", " + j);
}
int m() { j = 5; return j++; }
static public void main(String args[]) {
new Lang();
}
}
However, the following program yields "5, 1".
class Lang {
int i = m();
int j = 1;
Lang() {
System.out.println(i + ", " + j);
}
int m() { j = 5; return j++; }
static public void main(String args[]) {
new Lang();
}
}
- duplicates
-
JDK-4071284 Class variable initialization depends on placement of statements in file
- Closed