7.6. Kotlin and Java
Java and Kotlin classes can be used together in a Kotlin project with no limitations. However, each file should only contain code in one programming language: we can have Java files and Kotlin files, but different programming languages cannot be mixed in the same file.
It is easy to convert Java code into Kotlin. If you simply paste the Java code in Android Studio, the IDE will recognize that Java code has been pasted into a Kotlin file and start the conversion process automatically.