Kotlin, Android, Software Development, Kotlin Multiplatform, Java.
just like regular classes. @JvmInline value class Kilometer(val value: Int) { val meters: Int get() = value / 1000 fun printWithUnit() { println("$value km") } } // usage val kilometers = Kilometer(5) println(kilometers.meters) // prints "5000" kilometers.printWithUnit() // prints "5 km" Use value