<div dir="ltr"><div><div><div><div><div>Hello,<br><br></div>I have the following file Goo.java:<br>class A {<br>    public String m() { return &quot;aa&quot;; }<br>}<br>class B extends A {}<br>class C extends B  {<br>    public String m() { return &quot;cc&quot;; }<br>}<br>public class Goo extends C {}<br><br></div>I have a small Soot based application in which I make A, B, C, and Goo application classes, and for each of them I call c.declaresMethodByName(&quot;m&quot;), and if it returns true, then I print its units. I obtain the following output:<br><br>Goo: is declared? true<br>Units: (soot.jimple.internal.JIdentityStmt):  r0 := @this: Goo<br>Units: (soot.jimple.internal.JAssignStmt):  $r1 = specialinvoke r0.&lt;C: java.lang.String m()&gt;()<br>Units: (soot.jimple.internal.JReturnStmt):  return $r1<br>A: is declared? true<br>Units: (soot.jimple.internal.JIdentityStmt):  r0 := @this: A<br>Units: (soot.jimple.internal.JReturnStmt):  return &quot;aa&quot;<br>B: is declared? false<br>C: is declared? true<br>Units: (soot.jimple.internal.JIdentityStmt):  r0 := @this: C<br>Units: (soot.jimple.internal.JReturnStmt):  return &quot;cc&quot;<br><br><br></div>My question is then why it is considered that m is declared in Goo but not in B?<br><br></div>Thank you,<br></div>Eugen<br><br></div>