Before considering the addition of Kotlin to your existing Java code base, you have to think about how the two languages will work together. While Java and Kotlin can work well together, it's not always possible to take full advantage of Kotlin features from Java. In this section, we'll explore how you can leverage Kotlin code from Java and where the rough edges might be.
Working with Kotlin from Java
Basic interop
At a basic level, working with classes, interfaces, and objects written in Kotlin from Java is seamless. You can instantiate and consume these objects and methods in the same way as you would for any other Java class. We'll take a look at some specific examples in the following sections.
...