NumberFormatException
scala> "true".toBoolean
res1: Boolean = true
That’s pretty cool. Does it work for “false” too?
scala> "false".toBoolean
res1: Boolean = false
Yeah! Awesome! How does it handle other values, I wonder?
scala> "1".toBoolean
java.lang.NumberFormatException: For input string: "1"
… Err, what?