If

The if function evaluates the given expression and returns the first value if true, else the second.

The ternary operator implementation is backed by an if call, so that a ? b : c is equivalent to if(a, b, c).

T if(Boolean expr, T first, T second)

T is a type variable, so it can bind any type

  • if.txt
  • Last modified: 2019/07/01 14:25
  • by a.leofreddi