Java Equivalent to iif function

seba123neo picture seba123neo · Jan 13, 2011 · Viewed 58.7k times · Source

the question is simple, there is a functional equivalent of the famous iif in java?

For example:

IIf (vData = "S", True, False)

Thanks in advance.

Answer

Adrian Smith picture Adrian Smith · Jan 13, 2011
vData.equals("S") ? true : false

or in this particular case obviously one could just write

vData.equals("S")