Kotlin exception handling - try, catch, finally, throw
1. throw throw (keyword) + name of the customized exception + (code to throw) 2. normal code fun main() { val str = numberFunction("73") println(str) } fun numberFunction(str:String):Int{ return Integer.parseInt(str) } The variable 'str' has string type, and it is parsed by the function 'numberFunction' to int. Thus, the program prints '73' 3. error code fun main() { val str = numberFunction("7...
2022.05.29