Jd Sethi wrote:according to java basics the show function of class B will be executed here as it is bottom to class A.
Nope.
b.show() is declared as abstract, therefore it has no implementation, therefore there is no b.show() to execute. Same deal with a.show(). They both are just declarations and cannot be executed. A subtype must provide the implementation and in this case, that's c.show(), therefore the only executable show() is c.show().