Legacy code and migrations

5 concepts · 15 practice questions

Java interop

Kotlin and Java call each other freely, with a few seams. Java does not see default arguments, companion members need @JvmStatic to look static, and Kotlin has no checked exceptions, so Java callers need @Throws to catch them.

class Formatter {
    companion object {
        @JvmStatic
        @JvmOverloads
        @Throws(IOException::class)
        fun format(text: String, bold: Boolean = false): String = TODO()
    }
}

Also covered

From RxJava to coroutines
Fragments
RecyclerView and DiffUtil
Migrating safely

Sign in to read the rest and take the 15-question test.

Sign in to continue