Why Diffrence of annomous Impl of Interface declared in between Java and Kotlin

This is called SAM conversion and Kotlin only supports this for Java interfaces and not for Kotlin code. The documentation says:

Also note that this feature works only for Java interop; since Kotlin has proper function types, automatic conversion of functions into implementations of Kotlin interfaces is unnecessary and therefore unsupported.

If you want to dig deeper into this, here are a two past discussions of this topic:

1 Like