How to use ternary operator in scala.
I would like to simplify this:
var countA: Int = 0
var countB: Int = 0
if (itemList > 0) {
countB = 1
} else {
countA = 1
}
} else {
countB = 1
}
} else {
countA = 1
}
How do I use ternary operators in scala.
Aucun commentaire:
Enregistrer un commentaire