System.out.println("abc"+3+2); why output is abc32 and not abc5?
java
Solution
"abc"+3
converts 3 to a String
"abc3"
Then
"abc3" + 2
Converts 2 to a String as well
"abc32"
To get a numeric result do
"abc" + (3 + 2)
Problem
Possible Duplicate: Difference between int and int received by ParseInt in java System.out.println("abc"+3+2); // Output: abc32 System.out.println(3+2+"abc"); //Output: 5abc What is the reason ?