Hello! Quick question about printing ints | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
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 ответ
+ 2
System.out.print("a=" + a); //prints "a=6" System.out.print(a); //prints "6"
7th Sep 2016, 6:29 PM
Zen
Zen - avatar