+ 1

need help for java

hi what the different between this for java programme : (hours==4 ll hours==) and (hours>=4 && hours=<5)

28th Feb 2021, 9:52 AM
Iman Qasrina
5 Answers
+ 4
It is called logical operators. Learn logical operator in java.
1st Mar 2021, 12:11 PM
Wei Phyo Aung
Wei Phyo Aung - avatar
+ 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.
28th Feb 2021, 9:57 AM
Soumik
Soumik - avatar
+ 1
They are both wrong syntax. Repeat lesson "Conditional statements"
28th Feb 2021, 9:58 AM
Benjamin JĂŒrgens
Benjamin JĂŒrgens - avatar
0
ouh yeaa thanks for the explanation✹
28th Feb 2021, 10:01 AM
Iman Qasrina
0
ikr.. will try to fix and learn more
28th Feb 2021, 10:02 AM
Iman Qasrina