As we discovered in Chapter 1, A New Challenger Approaches, seamless interoperability with Java has been a primary goal for Kotlin since its inception. JetBrains started creating Kotlin primarily for themselves and needed the language to work with their extensive existing Java code bases and tooling. Tight integration with Java also would allow Kotlin to be used alongside existing Java code, making the barrier to entry smaller for developers looking to try Kotlin in existing projects.
Integrating with Java
Using Java from Kotlin
Because Kotlin is the new language on the block and was built to integrate with Java as seamlessly as possible, calling Java code from Kotlin code works out of the box. In this section, we'll...