I have some test code, which is a ConcreteClass
inheriting the AbstractClassForInterface1
.
In the generated smali code for the constructor of ConcreteClass
:
# direct methods
.method public constructor <init>()V
.locals 0
.prologue
.line 4
invoke-direct {p0}, Lorg/ucomb/AbstractClassForInterface1;-><init>()V
return-void
.end method
p0
is actually the instantiated object of type ConcreteClass
, since it's from the instantiation:
new-instance v0, Lorg/ucomb/ConcreteClass1;
invoke-direct {v0}, Lorg/ucomb/ConcreteClass1;-><init>()V
and it is easy to understand that the object v0
has the method Lorg/ucomb/ConcreteClass1;-><init>()V
,
Then in the body, why using invoke-direct
on the p0
to invoke the super class's constructor like this:
invoke-direct {p0}, Lorg/ucomb/AbstractClassForInterface1;-><init>()V
?
Isn't the invoke-direct
supposed to invoke method without virtual method resolution?