I am not really sure what this method does, or better I am not sure what " : " means. Can someone please help me understand?
private int guess( )
{
return isTrue( ) ? A : isFalse( ) ? B : neither( ) ? C : D;
}
This is a case of nested ternary operators which have the form a ? b : c which evaluates to:
if (a) then b, else c
So your question breaks down to this:
if (isTrue()) {
return A;
} else if(isFalse()) {
return B;
} else if(neither()) {
return C;
} else {
return D;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With