According to java 2+2=22. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
6th Jan 2020, 1:37 PM
Shubham kumar
Shubham kumar - avatar
1 Answer
+ 6
Arguments passed inside the println method are generally considered as a string. If you want to print 4 then do (2+2) because this will be executed first since the ( ) has higher precedence than +. One more thing you can learn from here is that in Java there is only one overloaded operator which is "+".
6th Jan 2020, 1:47 PM
Avinesh
Avinesh - avatar