Condition?True_Value:Flase_Value
Explain:
if(Condition == True)
{
return True_Value;
}
else
{
return Flase_Value;
}
Condition:Boolean Expression
True_Value:The Return Value When Condition Is True
False_Value:The Return Value When Condtion is False
Samples:
public Static int GetValue()
{
int iD;
Return iD =( 1 == 2 )?3:4;
}
The Result:4
You Must Catch On It.HaHa;
转载于:https://www.cnblogs.com/ComeOn/archive/2007/04/01/696312.html