+ 1

Int sum=x+y; sop(sum); instead in place of sum can we use x+y to print

18th Jun 2017, 9:08 AM
R Prathibha
R Prathibha - avatar
4 Respostas
+ 16
Yes, you can : System.out.print(x+y);
18th Jun 2017, 9:26 AM
Dev
Dev - avatar
+ 1
k fine
18th Jun 2017, 9:26 AM
R Prathibha
R Prathibha - avatar
+ 1
if your code contains x+y more than once then its useful to asign it a new variable.
18th Jun 2017, 9:41 AM
Szabó Gábor
Szabó Gábor - avatar