+ 2
Can you use: if(0<x<16)?
Do you have to create multilple statements to say "if x is greater than 0 and less than 16?"
10 Answers
+ 18
if (0 < x && x < 16)....is a better way
+ 3
Did you try it?
error: bad operand types for binary operator '<'
System.out.println (a<x<c)
^
first type: boolean
second type: Integer
1 error
Using numbers instead of variables just changes the second type to 'int'.
+ 2
use logical operator &&
+ 1
can we use (x>0 && Ă<16)
+ 1
You must use the logical operator && (and) to evaluate 0<x and x<16
0
why not?? what is wrong with the statement? it's the same as if(0<x&&x<16)
- 2
you can define such conditions in nested if.
- 3
No we cannot use this statement
- 3
noo
- 3
no