Hello everyone, I have a question about interopera...
# announcements
j
Hello everyone, I have a question about interoperability between Kotlin and Java. I have a Kotlin class
A
extend from a Java class
Base
which has a static function
f()
. When I called
A.f()
in a Kotlin file the IDE give an error ” Unresolved reference: f “. But when I called
A.f()
in a Java class, It works fine. I want to know the reason and maybe correct implementation. Thanks!
g
It’s correct, you should call Base.f() in Kotlin There are no statics in Kotlin and Kotlin doesn’t allow to use parent static methods using child class as Java