Browse topics
JVM & Interop
Java Interop
Call Java from Kotlin and Kotlin from Java with null safety and SAM.
java interopCalling Java from KotlinKotlin on JVM can use existing Java classes directly. A Kotlin example with source code and sample output.java interopCalling Kotlin from JavaKotlin classes compile to JVM bytecode callable from Java. A Kotlin example with source code and sample output.java interopKotlin Static Methods in JavaCompanion object functions can be exposed as static methods. A Kotlin example with source code and sample output.java interopKotlin Properties in JavaKotlin properties generate getter and setter methods for Java. A Kotlin example with source code and sample output.java interopNull Safety Java Interop in KotlinJava types are platform types in Kotlin with unknown nullability. A Kotlin example with source code and sample output.java interopKotlin SAM Conversions in KotlinSAM conversion allows lambda where Java functional interface is expected. A Kotlin example with source code and sample output.