Skip to content

Glossary: Kotlin Basics

NumberFormatException

The exception raised when `toInt()` is given text that isn't a number, such as `two`. `toIntOrNull()` avoids it.

Where the book teaches it

Related terms

toInt / toDouble / toIntOrNull / toDoubleOrNullexceptiontry / catch