Reputation: 436
I have abstract java class. Also I have kotlin class which extends abstract java class. Why the overrides java methods doesn't calls in kotlin class? For example:
public abstract class A {
public void myMethod() {
Log.d("test", "test");
}
}
open class B:A(){
override fun myMethod {
super.myMethod() // doesn't called
}
}
Upvotes: 1
Views: 64
Reputation: 56
Probably you just doesn't call myMethod
from class B
.
public abstract class A {
public void myMethod() {
System.out.println("test");
}
}
open class B : A() {
override fun myMethod() {
super.myMethod()
}
}
fun main() {
B().myMethod()
}
Code above will print test
in the console.
Upvotes: 1