3 ms·
> 1 + "five" Forget JavaScript, that's not even an error in Java.
by paulddraper 3y ago
> 1 + "five"
Forget JavaScript, that's not even an error in Java.
- marcosdumay 3y agoYes, Java has this one strong inconsistency on its type system. The interesting thing is that the addition operator has a not completely predictable behavior exactly because the language designers insisted that custom operators reduce the language predictability. But anyway, it's much less bad in Java because you can force it to err by declaring what type of thing you want it to return.