This chapter will explore the practical ramifications of adding Kotlin to an existing Java code base. Because rewriting an application from scratch in a new language is a risky and rare endeavor, this chapter details how to work with both Java and Kotlin in a single code base. It explores some of the challenges associated with adding Kotlin to an existing Java code base, such as the differences in the null handling and the lack of Kotlin features in Java. Finally, it will examine common Kotlin idioms and how they affect the way you write code with both Kotlin and Java.
The following topics will be covered in this chapter:
- Working with Kotlin from Java
- Working with Java from Kotlin
- Impacts and considerations when working with both Java and Kotlin in the same code base
- Embracing Kotlin idioms