In Scala we have a require method that is used to set preconditions to classes like this
class Rational(x: Int, y: Int) {
require(y != 0, "denominator must be different than zero ")
My question is: Do we have something like that in Kotlin?
In Scala we have a require method that is used to set preconditions to classes like this
class Rational(x: Int, y: Int) {
require(y != 0, "denominator must be different than zero ")
My question is: Do we have something like that in Kotlin?