+ operator is overloaded. If one of the operand is of type
String it performs concatenation.
1: System.out.println(" " +2 + 3);
If you take line number 1, associativity is from left to right so first it does " "+2 and the output will be string.that stirng again conatenated with 3.So output will be 23.
3: System.out.println(2 + 3 +"");
If you take line number 3,it does 2+3 =5 ,then 5+"" =5