In reply to Parveez ahamed:
All class methods are defined with an implicit this handle argument. So your method b is really
function int top::b(top this, int i=0);
$display("Class Handle %0d,Calling function B ",i);
return(i);
endfunction
and any call to a method is replaced with
$display(top::b(top1[2],2));
It happens that your method b does not refer to any class properties, so the this handle is never referenced. If instead you wrote you method b to display a
function int b();
$display("Class Handle %0d,Calling function B ",a);
return(i);
endfunction
it would get converted to
function int top::b(top this);
$display("Class Handle %0d,Calling function B ",this.a);
return(i);
endfunction
A null this handle would produce an error.