+ 1
need help for java
hi what the different between this for java programme : (hours==4 ll hours==) and (hours>=4 && hours=<5)
5 Answers
+ 4
It is called logical operators.
Learn logical operator in java.
+ 1
(hours==4 ll hours== (some number))
If the value of variable hour is 4 or 5, then this returns true. The OR operator stops checking as soon as any one condition matches.
(hours>=4 && hours<=5)
If value of hours is greater than or equal to 4 and it is also less than or equal to 5, this returns true.
+ 1
They are both wrong syntax. Repeat lesson "Conditional statements"
0
ouh yeaa thanks for the explanationâš
0
ikr.. will try to fix and learn more