5 concepts · 15 practice questions
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()
}
}
Sign in to read the rest and take the 15-question test.
Sign in to continue