We first note that "(" is a a String
literal while '(' is a char literal.
Using the latter we have:
The question's first expression starts with a String
literal "(". »Adding« 10 works by converting the
int literal 10 into a String
"10" prior to concatenating both into
"(10". This continues until the char
literal ')' is being implicitly converted into
")" and then being appended as well.
-
The second expression starts wit a char
literal '(' represented by the ASCII value of 40.
Adding 10 this time is a regular char + int
arithmetic operation yielding 50. Next follows the String
literal " times more text". Thus 50 gets
converted into "50" and the concatenation then yields
"50 times more text".
-
The first '(' brace is being consumed by the
addition.
This task closely resembles Why using braces in IO.println(...)
? .