Appendix A. Mixing Kotlin with Java
Kotlin was first created as a language running on the Java Virtual Machine (JVM). JetBrains then introduced Kotlin JS, a version of the language running on the JavaScript VM, as well as Kotlin/Native, a version compiling to native binaries that runs without any VM. The vast majority of Kotlin programs are, however, designed to run in the JVM environment.
Such programs take advantage of the Java standard library, meaning that you can call any method of this library from a Kotlin program. There’s no limit to this, although you should probably not call any of these methods without first verifying whether Kotlin offers a better solution. On the other hand, Java programs can use libraries developed in Kotlin, although ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access