Join Slack
Powered by
<if else return in kotlin> <https://i.stack.imgur....
# stackoverflow
u
user
07/12/2022, 2:51 PM
if else return in kotlin
https://i.stack.imgur.com/IhZcC.png
▾
Error : Kotlin: Type mismatch: inferred type is String but Unit was expected code : fun main() { val a = 2 var data: String = if (a != 2) { return "Hello" } else { return "World" } }
3
Views
Open in Slack
Previous
Next