I noticed something rather strange while working in my IDE.
double x1 = 0, x2 = 0;
int a = (int) x1 = (int) x2;
So this is an invalid syntax, unsurprisingly. However, this is an explanation of why this is an invalid syntax that confuses me. When I put this code in the Eclipse Luna and hover over the second line, a message appears saying:
Type mismatch: cannot convert from boolean to int
1 quick fix:
Change type 'a' to 'boolean'
If I ignore the error and continue to work anyway, even the Throwable stack trace shows the same message:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Type mismatch: cannot convert from boolean to int
Syntax error on token "=", <= expected
, , (int) x1 = (int) x2 - - , true false. - , ?