I think the answer is 5Code :
double x = 7 / 2 + 1.5;
If n has the value 3, what is the value of the expression:
2 + n * 2 > 9
Thanks in advance,
NightFire91
Printable View
I think the answer is 5Code :
double x = 7 / 2 + 1.5;
If n has the value 3, what is the value of the expression:
2 + n * 2 > 9
Thanks in advance,
NightFire91
The expression gives the
boolean object false
because multiplication preceeds addition..and so 8>9 which results in false
Its because the number used is an integer dataType...and not the double type..so if you add, subtract, multiply and divide the integer, the result is also an integer and not double.... so in that case 7/2=3 not 3.5