What is unit type in Kotlin?

The Unit type is what you return from a function that doesn’t return anything of interest . Such a function is usually performing some kind of side effect. The unit type has only one possible value, which is the Unit object. You use Unit as a return type in Kotlin when you would use void (lowercase v) in Java.

Sizin İçin Seçtik  Can I learn Kotlin in 2021?

Leave a Reply

Your email address will not be published. Required fields are marked *