The difference is that the last station can be used to return a value based on the condition.
For example, if you have the following statement:
if (SomeCondition())
{
text = "Yes";
}
else
{
text = "No";
}
Using the ternary operator, you will write:
text = SomeCondition() ? "Yes" : "No";
Notice how the first example executes a statement based on a condition, and the second returns a value based on a condition.
source
share