+ 2
Why do I get this output?
System.out.print(1+2+''Hello''+1+2); why do I get 3Hello12? *edit: apparently I've found out. that's because operations get solved sequentially from left to right so: 1+2=3 (int) 3+Hello= 3Hello (String) 3Hello+1 = 3Hello1 (String) 3Hello1+2= 3Hello12 (String)
4 Answers
+ 10
hey michael , R U sure that this was answer , might a wrong quiz got approved
actually + is overloading operator , for strings it conacatinate & for numbers it to addition
// u will get 3Hello12
//AGAIN A WRONG QUIZ GOT APPROVED đ
+ 8
@empty , no bro
answer will be 3Hello12
+ 2
I cleaned it up
0
why won't the answer be 3hello3