4 ms·
It's evaluates left to right. (1+2)=3 then concat with string = then concat with 1 and concat with 2. The optimiser converts these concats to a StringBuilder.
by danielmg 9y ago
It's evaluates left to right.
(1+2)=3 then concat with string = then concat with 1 and concat with 2.
The optimiser converts these concats to a StringBuilder.
https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.18.1 https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.htm...
Second time I've seen something like this on HN.