What is value of d can u explain these? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is value of d can u explain these?

class Program { public static void main(String[] args) { boolean d; int a=2,b=3,c=0; d=a>b>c; System.out.println("d="+d); } }

28th Jan 2017, 10:18 AM
Saiyyed aman ali
Saiyyed aman ali - avatar
3 Answers
+ 9
d=a>b>c (a>b is calculated first and returns "0" because it is fault) d=0>c (returns "0" again…)
28th Jan 2017, 10:21 AM
Valen.H. ~
Valen.H. ~ - avatar
+ 1
change d=a>b>c; to d=a>>b>c; the output will be d=false
28th Jan 2017, 10:22 AM
Jidesh
+ 1
yea I got it thnx but how it works d=a>>b>c
28th Jan 2017, 10:28 AM
Saiyyed aman ali
Saiyyed aman ali - avatar