What is the difference between ...? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is the difference between ...?

What is for example the difference: 1.: if(a+b) 2.: if((a+b)) i mean generally, i see often that they do another Bracket around statements why?

9th Feb 2017, 9:00 PM
Baran
Baran - avatar
2 Answers
+ 1
I don't think you can add booleans like that and java has some dignity to not have implicit casts from integer (or other type) to bool. So what a+b is supposed to mean?
9th Feb 2017, 9:13 PM
Zilvinas Steckevicius
Zilvinas Steckevicius - avatar
+ 1
ok that was wrong, because i didn't understand it sometimes they do if((statement))
9th Feb 2017, 9:40 PM
Baran
Baran - avatar