System.out.println(x + y + foo());
The expression "x+y+foo()" in println is evaluated from left to right.
If either operand is a String, the + operator becomes a String concatenation operator. If both operands are numbers, the + operator is the addition operator.
So, as x and y are numbers(long) they get added and gives 86 and after the result of addition, we are left with 86 and other String operand("foo") which gets concatenated resulting in to: 86foo.