Take the first case
boolean b1 = false?false:true?false:true?false:true;
it has got 3 parts
1 - that which is coming before ? --> false
2 - one that is between ? and : --> false
3 - which is placed after : --> true?false:true?false:true;
since the boolean expression (one that is coming in the first part)is having false value, the statement coming after :
is evaluated.ietrue?false:true?false:true;
Again that is another conditional statement. so split that into 3 parts
1 --> true
2 --> false
3 --> true?false:true;
since here the boolean expression is true, it will have the value placed in the second part ie false
take the third case
boolean b3 = ((false?false:true)?false:true)?false:true;
SECTION 1 --> ((false?false:true)?false:true) ? false : true;
Because of parantheses, the 3 parts will be
1 --> ((false?false:true)?false:true)
2 --> false
3 --> true;
SECTION 2 --> (false?false:true)?false:true)
Evaluate the first part which is itself another conditional expression. So split that again
11-->(false?false:true)
12--> false
13 --> true
SECTION 3 --> false?false:true
Again split the first part of 11
111--> false
112--> false
113 --> true
since 111 is false the third part will be returned which is having the value true.
This value will be substituted in SECTION 2. So it become
(true)?false:true
From here false value will be returned and substituted in SECTION 1.
so it become false? false : true
thus b3 will have the value true
You can
test the second case by yourself.