# NumberFormatException

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# NumberFormatException

```
open class NumberFormatException : IllegalArgumentException
```

|---|---|---|---|---|--------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                 ||||||
| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)                                  |||||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/kotlin/java/lang/Exception)                                   ||||
|   |   | ↳ | [java.lang.RuntimeException](https://developer.android.com/reference/kotlin/java/lang/RuntimeException)                  |||
|   |   |   | ↳ | [java.lang.IllegalArgumentException](https://developer.android.com/reference/kotlin/java/lang/IllegalArgumentException) ||
|   |   |   |   | ↳ | [java.lang.NumberFormatException](https://developer.android.com/reference/kotlin/java/lang/NumberFormatException#) |

Thrown to indicate that the application has attempted to convert a string to one of the numeric types, but that the string does not have the appropriate format.

## Summary

|                                                                                                                                                Public constructors                                                                                                                                                ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [NumberFormatException](https://developer.android.com/reference/kotlin/java/lang/NumberFormatException#NumberFormatException())`()` Constructs a`NumberFormatException`with no detail message.                                                                                                                 |
| [NumberFormatException](https://developer.android.com/reference/kotlin/java/lang/NumberFormatException#NumberFormatException(kotlin.String))`(`s:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Constructs a`NumberFormatException`with the specified detail message. |

## Public constructors

### NumberFormatException

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
NumberFormatException()
```

Constructs a`NumberFormatException`with no detail message.  

### NumberFormatException

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
NumberFormatException(s: String!)
```

Constructs a`NumberFormatException`with the specified detail message.

|                                                 Parameters                                                 ||
|-----|-------------------------------------------------------------------------------------------------------|
| `s` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:the detail message. |