Kotlin中三元运算符

Java中三元运算符
int a = 10;
int b = 11;
int c = a > b ? a : b;

kotlin中 
val a = 10
val b = 11
val c = if (a > b) a else b

你可能感兴趣的:(Android)