# Kotlin and Java interoperability: Traps and gotchas

DevFeed: [Kotlin and Java interoperability: Traps and gotchas](<https://devfeed.tech/articles/kotlin-and-java-interoperability-traps-and-gotchas-39204.md>)

Original publisher: [Read original article](<https://kt.academy/article/ak-java-interop-4>)

Published: 2023-08-21T00:15:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [interoperability](<https://devfeed.tech/topics/interoperability.md>), [Java](<https://devfeed.tech/topics/java.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [gotchas](<https://devfeed.tech/topics/gotchas.md>), [exceptions](<https://devfeed.tech/topics/exceptions.md>)

Tags: [gotchas](<https://devfeed.tech/tags/gotchas.md>), [interoperability](<https://devfeed.tech/tags/interoperability.md>), [java](<https://devfeed.tech/tags/java.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [mockito](<https://devfeed.tech/tags/mockito.md>), [unit-test](<https://devfeed.tech/tags/unit-test.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

## AI overview

This tutorial explains surprising aspects of Kotlin and Java interoperability, including return types, function types and functional interfaces, Java keywords used in Kotlin names, Mockito's `when` function, Kotlin/JVM naming constraints, and Java checked exceptions.

## Source excerpt

The parts of Kotlin and Java interoperability that might be surprising or counterintuitive.