Hi Ritu,
Consider it stepwise:
1)boolean b1 = false?false:true?false:true?false:true;
Evaluate from right to left in steps:
true?false:true = false
Then
true?false:false = false
Then
false?false:false
so finally , b1=false;
2)boolean b2 = false?false
true?false
true?false:true));
Here, the brackets are evaluated first starting with the innermost bracket on the right.
So you have:
(true?false:true) = false
Then
(true?false:false) = false
Then
(false?false:false) = false
so finally, b2 = false
3) boolean b3 = ((false?false:true)?false:true)?false:true;
Again the brackets are evaluated first, this time, the innermost bracket is on the left. So starting from LEFT,
(false?false:true) = true
Then
(true?false:true) = false
Then
false?false:true = true
So finally, b3 = true.
So we have now, m1(false) + m1(false) + m1(true)
and m1 returns T if true and F if false in (b?"T":"F")
So m1(false) = F
m1(false) = F
and m1(true) = T
Hence finally we get FFT.
Hope it is clear now ??
[ September 13, 2005: Message edited by: Barry Gaunt ]