iOSエンジニアのつぶやき
id:yum_fishing
【Kotlin】Unitとは
Unitとは? Javaのvoidに対応する、Kotlinのオブジェクトのようです。 The type with only one value: the Unit object. This type corresponds to the void type in Java. つまり、下記のような戻り値のない関数などは、Kotlinではvoidではなく、Unitが返されます。 // return: Unit fun hoge() { println("") } また、Un…