hi togeth i am a java developer. and i will hove s...
# getting-started
e
hi togeth i am a java developer. and i will hove something like nullable/optional in a data class. how can i do that ?
r
I don't recommened the use of optional in kotlin, rather use null. Optional tries to solve NPE in java. Kotlin is build with null safety in mind. Look at the docs that Shawn mentoined for what kotlin has built in.
k
If you would implement this in Kotlin you'd use sealed classes: https://kotlinlang.org/docs/reference/sealed-classes.html
👆 1