The first is not possible because you cannot convert String to int this way.
The second one works because char is a kind of number, so adding char adds the numbers that they really are. Char '1' is the number 49 (see ASCII table), so the sum is 49 + 50 + 51, which is 150.
The third works this way because + is the operator in brackets on the left, which means that 'a'+'b'+'c'+"" should be read as (('a'+'b')+'c')+"" . 'a' has an ASCII code of 97, so you have 294+"" . Then Java knows that you need to convert the value to String in order to be able to bind two strings. At the end you will get line 294 . Change your last code to the following System.out.println('a'+'b'+('c'+"")); , and you will see that the result will be 195c .
You should notice that System.out.println is a method that is used to convert values (of different types) to their String representation. This is always possible, since each int can be converted to a String representation, but not vice versa; not every String is an int representation (therefore, Java will not allow you to do this so simply).
Jean-baptiste yunès
source share