27th Oct 2017, 12:07 PM
Ibrahim Elsayed
Ibrahim Elsayed - avatar
3 Antworten
+ 4
System.out.println(i + ' ' + x[i]); Java converted the char ' ' into its number in ASCII, a space(' ') ASCII number is 32, so it is: 0 + 32 + 0 => 32 1 + 32 + 0 => 33 2 + 32 + 0 => 34 System.out.println(i + " " + x[i]); Java concatenate and cast operands as necessary so all the operands are treated as string. "0 0" "1 0" "2 0" Hth, cmiiw
27th Oct 2017, 1:25 PM
Ipang
0
Because the first does addition of the 3 values, while the second does string concatenation.
27th Oct 2017, 12:48 PM
John Wells
John Wells - avatar
0
oh , thank you all. I appreciate that 😁😍 Now I understood
27th Oct 2017, 2:05 PM
Ibrahim Elsayed
Ibrahim Elsayed - avatar