Exception message

Report a typo

In the code below, the function that can potentially cause an exception is called in the try block. Write the catch statement so that it prints information about this exception in the form of a message (in case it happened in the try statement).

Write a program in Kotlin
// ...
try {
problemFunction()
} catch (e: Exception) {
println()
}
// ...
___

Create a free account to access the full topic