P
Philipp
Hello,
In the following code the first assignment compiles OK but the second
doesn't. I am surprised that the first is OK, but couldn't find the
exact ref in the JLS which specifies this conversion/promotion.
Could someone point me to the right part of the JLS? Thanks Phil
public class ATest {
public static void main(String[] args) {
float f = 12.3f;
double d = 32.1;
f += d; // is OK
f = f + d; // does not compile
}
}
In the following code the first assignment compiles OK but the second
doesn't. I am surprised that the first is OK, but couldn't find the
exact ref in the JLS which specifies this conversion/promotion.
Could someone point me to the right part of the JLS? Thanks Phil
public class ATest {
public static void main(String[] args) {
float f = 12.3f;
double d = 32.1;
f += d; // is OK
f = f + d; // does not compile
}
}