Just for the record (and completeness): the
+ operator will work on String, but will not perform addition (like with two
ints), but concatenation. So for all primitives (except
boolean) the
+ is an arithmetic operator for addition (and that's including
chars!), and for
Strings it's a concatenation operator for (obviously) concatenating.
Pop quiz question time! Do you know the output of this code snippet? And "yes" or "no" is not a valid answer
Hope it helps!
Kind regards,
Roel