0

Java is this valid?

is j & k is valid,this (if statement) will valid? if(j < k /2)

30th May 2019, 1:36 PM
Tzion
Tzion - avatar
3 odpowiedzi
+ 3
Wang Teng Zheng if you can link the come then I can give more clear explanation but without that if you are taking any number which is non zero value from 1 to n the statement will be false. And in negative range it will be true
30th May 2019, 2:26 PM
DishaAhuja
DishaAhuja - avatar
+ 2
Wang Teng Zheng hi, Your sample statement is not valid at j=k=0 as 0<0 is false and any other number like 1<1/2 which is false too so all conditions will false for 0 and great then 0 values
30th May 2019, 1:55 PM
DishaAhuja
DishaAhuja - avatar
0
DishaAhuja how if j and k got number ,its valid? cuz not boolean type in if statement?
30th May 2019, 2:06 PM
Tzion
Tzion - avatar