Could someone explain me, why a
is equals 2'147'483'647
?
int a = (int)(3434 * 2353253.0)
Why is this "sticking to Integer.MAX_VALUE" happening?
I expected some integer overflow behavior and a result of -508'863'790
(openjdk 11.0.16.1 2022-08-12)
It's happening because the Java language says it must. See section 5.1.3, Narrowing Primitive Conversion.
This last clause is what you are witnessing in action.