That's not always the case, since Kotlin can generate Java 6 compatible bytecode.
163 karma · joined December 23, 2018
Blog: https://www.driver733.com GitHub: https://github.com/driver733
Thanks for the feedback.
result = Optional.ofNullable(nullableVariable)
.map(NullableType::someMethodCall)
.orElseGet(() -> fallbackIfNullMethodCall());For instance, in Kotlin you can perform operations on collection without converting them to a stream first, and collecting them with a certain collector afterwards. So in order to perform a single filtering operation on a collection, you need to do three steps in Java and just one in Kotlin.
Another advantage is coroutines, which not only allow you to write asynchronous code in a common, synchronous manner, but also get rid of shared mutable state, since coroutines can send/receive shared state through channels.