what would be a better way to do this in Kotlin? (...
# announcements
p
what would be a better way to do this in Kotlin? (this does not compile)
Copy code
class Example(iVal: String) {
    private val i: Int

    init {
        try {
            i = Integer.parseInt(iVal)
        } catch (fmtException: NumberFormatException) {
            System.exit(1)
        }
    }
}