Calling Kotlin from Java

This Atom is Under Construction

Kotlin makes it easy to produce libraries that are usable from Java.

For the Java programmer, a Kotlin library looks like just another Java library.

Because everything in Java is a class, let’s start with a Kotlin class containing a property and a function:

// fromjava/KotlinClass.kt package mypackage class Basic { var property1 = 1 fun value() = property1 * 10 }

End of sample. See for full early-access book.

Previous          Next

©2018 Mindview LLC. All Rights Reserved.