In this tutorial, we will discuss the architecture of Kotlin programming language and its Interoperability feature. As you know we write Kotlin code in .kt file. Kotlin compiler converts that Kotlin code written in .kt file into byte code. That byte code is exactly the same as Java compiler generates for .java class file. That means the byte code can run of JVM (Java Virtual Machine) the same way as the java byte code can run on it. The following image explains the Kotlin Architecture.
Why Kotlin is Called Interoperable Language?
Interoperability in programming languages means that the ability of a programming language to interact with the other programming languages. As you can see in the above picture, the Kotlin compiler generates the JVM compatible byte code the same as the Java byte code. That means both codes can communicate with each other and hence we say that Kotlin is an Interoperable programming language.
No More Null-Safety While Calling Java Code
As we discussed in the previous tutorial that Kotlin is a null safe language but if we call Java code from Kotlin, we will not be able to enjoy this Kotlin feature of Null-Safety and we can face NullPointerException causes by Java code.