Kotlin - Data Types
What is wrong with this Kotlin function?
fun logMessage(): Unit {
return 10
println("Logging")
}fun logMessage(): Unit {
return 10
println("Logging")
}Unit, so it cannot return an Int value like 10.println after return is unreachable, the main error is returning a value incompatible with Unit.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions