0

Hello! Quick question about printing ints

int c = 2; int b = 3; int a = c * b; System.out.print("a=" + a); output a = 6 !!! Why do I have to set ("a="+a) vs just print(a) ?? Ive searched a bunch of documentation but found no coverage on the matter....

7th Sep 2016, 6:15 PM
Joel Higgins
Joel Higgins - avatar
1 Odpowiedź
+ 2
System.out.print("a=" + a); //prints "a=6" System.out.print(a); //prints "6"
7th Sep 2016, 6:29 PM
Zen
Zen - avatar